R
Ryan Lafferty
Hi,
I have a DataGrid control with a checkbox template column, and want to
make the checkbox "disappear" when the 3rd column of the DataGrid
contains the string "number". Is what I am trying to do impossible?
This is what I have so far, but cannot get the darn thing to work:
------------------------------------------
Private Sub myDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
myDataGrid.ItemDataBound
Dim asdf As CheckBox
asdf = CType(e.Item.FindControl("chk1"), CheckBox)
If InStr(e.Item.Cells(3).Text, "Number") > 0 Then
asdf.Visible = False
Else
asdf.Visible = True
End If
end Sub
I have a DataGrid control with a checkbox template column, and want to
make the checkbox "disappear" when the 3rd column of the DataGrid
contains the string "number". Is what I am trying to do impossible?
This is what I have so far, but cannot get the darn thing to work:
------------------------------------------
Private Sub myDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
myDataGrid.ItemDataBound
Dim asdf As CheckBox
asdf = CType(e.Item.FindControl("chk1"), CheckBox)
If InStr(e.Item.Cells(3).Text, "Number") > 0 Then
asdf.Visible = False
Else
asdf.Visible = True
End If
end Sub