チェックボックスとテキストボックスを含むグリッドビューがあります。私の目的は、ユーザーが横のチェックボックスをチェックしていない限り、テキストボックスを無効にすることです。RowDataBound Event を使用していますが、いくつかの手順が不足していると思います。このコードは起動していません。お知らせ下さい。
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
前もって感謝します。