Saturday 8 October 2011

How to Disable a Data Grid Column button from Code Behind


Public Sub DisableButton()
For totalrow = 0 To dgWelStatus.Items.Count - 1

If (CType(dgWelStatus.Items(totalrow).FindControl("lblStatusid"), Label).Text) = "790" Or (CType(dgWelStatus.Items(totalrow).FindControl("lblStatusid"), Label).Text) = "795" Or (CType(dgWelStatus.Items(totalrow).FindControl("lblStatusid"), Label).Text) = "797" Then
                    CType(dgWelStatus.Items(totalrow).FindControl("BtnAr_no"), Button).Enabled = False
                End If
            Next
End Sub

No comments:

Post a Comment