I am using the below code to change the button status(Enable or Disable). But it’s working for the first control, the second and third control status not changed. Please help me to fix this error.
If (e.Item.ItemType = DataControlRowType.DataRow) Then
Dim status As Button = CType(e.Item.FindControl("btnstatus"), Button)
If status IsNot Nothing Then
If status.Text = "Ready" Then
status.Enabled = True
ElseIf status.Text = "Assigned" Then
status.Enabled = False
Else
status.Enabled = False
End If
End If
'do what ever you want to do here using the value of your label
End If
Try this: