I have a gridview that contains a checkbox and a textbox. My objective is to disable the textbox as long as the user hasn't check the checkbox beside it. I am using RowDataBound Event but I think I'm missing some steps. This code is not firing. Please advise.
Protected Sub GV_1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim drview As DataRowView = TryCast(e.Row.DataItem, DataRowView)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim SFtxt As TextBox = DirectCast(e.Row.FindControl("TB_AdjustSF"), TextBox)
Dim adjSF As Double = SFtxt.Text
'Find checkbox and checked/Unchecked based on values
Dim chkb As CheckBox = DirectCast(e.Row.FindControl("selectitem"), CheckBox)
If chkb.Checked = True Then
SFtxt.Enabled = True
Else
SFtxt.Enabled = False
End If
End If
End Sub
Thanks in advance.