-
Datagrid footer...
I have a datagrid that has the footer showing. The problem I have is that the footer is actually a footer for each column, so the column separators are showing.
What I would like is just something to pad the empty space I have after the last row in the grid.
If it was normal HTML, I would just insert another row in the table with a colspan of how ever many columns I had, and a height of 100%.
How would I do the same thing with a datagrid?
:)
-
In the databind event for the datagrid, test for e.itemtype being a footer.
Then, programmatically remove the cells and then change the column span of the first cell to span all of your columns.
What's even better is I'll show you how!
PHP Code:
if e.item.ItemType = ListItemType.Footer then
Dim numberofCells as Integer = e.Item.Cells.Count
Dim x as Integer
For x = 0 to numberOfCells - 2
e.Item.Cells.removeAt(0)
Next
e.Item.Cells(0).Text = "your text here" 'use if you have no text
e.Item.Cells(0).ColumnSpan = numberOfCells
e.Item.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Item.Cells(0).Attributes.Add("height","100%")
-
Thanks, I'll give it a shot.
:)