G
Guest
I'm trying to change a value of a cell based on another before the grid is
displayed. I'm using the ItemDataBound event like this for a simple test:
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
If e.Item.Cells(7).Text = String.Empty Then
e.Item.Cells(7).Text = "hello"
End If
End Select
The problem? e.Item.Cells(7).Text always shows that the cell is empty for
every row in the datagrid, even though some of the records being pulled from
the database might have a value for that cell!
To prove it, if I comment out the above Select/Case statements, the data
pulled from the database into the grid is displayed as it should be.
If it helps, the cell is a template column. Am I using the wrong event? I
tried to ItemCreated event before trying the ItemDataBound event, but that
didn't work either.
displayed. I'm using the ItemDataBound event like this for a simple test:
Select Case e.Item.ItemType
Case ListItemType.Item, ListItemType.AlternatingItem
If e.Item.Cells(7).Text = String.Empty Then
e.Item.Cells(7).Text = "hello"
End If
End Select
The problem? e.Item.Cells(7).Text always shows that the cell is empty for
every row in the datagrid, even though some of the records being pulled from
the database might have a value for that cell!
To prove it, if I comment out the above Select/Case statements, the data
pulled from the database into the grid is displayed as it should be.
If it helps, the cell is a template column. Am I using the wrong event? I
tried to ItemCreated event before trying the ItemDataBound event, but that
didn't work either.