Tina said:
in the itemDatabound event of a datagrid, both null fields and blank
string come through as in the e.items.cells field. Is there anyway
to tell them apart?
Thanks,
T
Yes there is a way to tell...
If e.Item.ItemType <> ListItemType.Footer AndAlso _
e.Item.ItemType <> ListItemType.Header AndAlso _
e.Item.ItemType <> ListItemType.Separator AndAlso _
e.Item.ItemType <> ListItemType.Pager
' If the data item is a data set, use the following :
Dim ds As DataSet = DirectCast(e.Item.DataItem, DataSet)
' If it's a data table, use the following :
Dim dt As DataTable = DirectCast(e.Item.DataItem.Row, DataRow)
End If
HTH
Mythran