I have a gridview that drives a formview. The formview and gridview both have a field called condtion. The formview has an itemtempate and edititemtemplate.
If the condition = 'sold' or 'pending sale' or 'pending transfer' then I don't want the formview to go into edit mode.
I thought the nicest/cleanest method would be to check the value of condition and make the edit button visible/hidden based on the field but I can't find an event on the formview to allow me to do this.
If the condition = 'sold' or 'pending sale' or 'pending transfer' then I don't want the formview to go into edit mode.
I thought the nicest/cleanest method would be to check the value of condition and make the edit button visible/hidden based on the field but I can't find an event on the formview to allow me to do this.
Code:
Dim x As Label = FormView2.FindControl("ConditionLabel")
Dim y As Button = FormView2.FindControl("EditButton")
If x.Text = "Sold" Or x.Text = "Pending Sale" Or x.Text = "Pending Transfer" Then
y.Visible = False
Else
y.Visible = True
End If