M
MattB
I'm trying to set a column name when my datagrid is being rendered. I've
used the OnItemDataBound event before, so I decided to try and use it again
here.
The problem I'm having is I'm trying to test for a DataColumn from the bound
source with a name of "Info" and I'm not sure how to do that. Here's what
I've been trying:
Sub GuestGrid_OnItemDataBound(ByVal source As Object, ByVal e As
DataGridItemEventArgs)
'only bother header items
If (e.Item.ItemType = ListItemType.Header) Then
'Set the variable Info column heading text
If Not IsNothing(Trim(e.Item.DataItem("Info"))) Then
e.Item.Cells.Item(0).Text = "testing"
End If
End If
End Sub
------------------------------
The part I'm having trouble with is that If Not
IsNothing(Trim(e.Item.DataItem("Info"))) part. That errors out. How can I
detirmine if there is a column with the name "Info"? Thanks!
Matt
used the OnItemDataBound event before, so I decided to try and use it again
here.
The problem I'm having is I'm trying to test for a DataColumn from the bound
source with a name of "Info" and I'm not sure how to do that. Here's what
I've been trying:
Sub GuestGrid_OnItemDataBound(ByVal source As Object, ByVal e As
DataGridItemEventArgs)
'only bother header items
If (e.Item.ItemType = ListItemType.Header) Then
'Set the variable Info column heading text
If Not IsNothing(Trim(e.Item.DataItem("Info"))) Then
e.Item.Cells.Item(0).Text = "testing"
End If
End If
End Sub
------------------------------
The part I'm having trouble with is that If Not
IsNothing(Trim(e.Item.DataItem("Info"))) part. That errors out. How can I
detirmine if there is a column with the name "Info"? Thanks!
Matt