S
SRuby
Hi,
I try to disable /hide datagrid checkbox when the value of the field is
null,
I have try to put some code in ItemDataBound to invisible the checkbox
when databind() fired
Here's the codein ItemDataBound event
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)
If drv("isexist").ToString = "" Then
e.Item.Cells(2).Visible = False
end if
end if
When I debug the program, the ItemDataBound was triggered once when the
ListItemType = Header, after that, the error raises
Cast from type 'DBNull' to type 'Boolean' is not valid.
Why the OnItemDataBound only triggered once?
thank
Ruby
I try to disable /hide datagrid checkbox when the value of the field is
null,
I have try to put some code in ItemDataBound to invisible the checkbox
when databind() fired
Here's the codein ItemDataBound event
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)
If drv("isexist").ToString = "" Then
e.Item.Cells(2).Visible = False
end if
end if
When I debug the program, the ItemDataBound was triggered once when the
ListItemType = Header, after that, the error raises
Cast from type 'DBNull' to type 'Boolean' is not valid.
Why the OnItemDataBound only triggered once?
thank
Ruby