Hi,
I new to asp .net, and I have problem with checkbox bound in datagrid,
I want to detect when the field value is null the check box will hide / invisible.
I have try to code in onItemDataBound like this:
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or _
e.Item.ItemType = ListItemType.EditItem Or e.Item.ItemType = ListItemType.SelectedItem Then
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
e.Item.Cells(2).Visible = (drv("mn_checked").ToString <> "")
end if
-------------------------------------------------------------------
But still got error:
Cast from type 'DBNull' to type 'Boolean' is not valid.
Thank
Ruby