I'm using the radgrid and I need to be able to add a row dynamically based on a certain condition. The table looks something like this:
|col0|col1|
|0,0 |1,0 |
|0,1 |1,1 |
|0,2 |1,2 |
开发者_运维知识库But I want to be able to add pseudo-headers based on a condition:
|col0|col1|
|0,0 |1,0 |
|header |
|0,1 |1,1 |
|0,2 |1,2 |
The header row is not in the underlying data, I just want to add it if the condition is triggered. I don't think I can do this in the ItemTemplate itself, because I need to span all the columns, and this requires a separate table row. But I also can't find any way to accomplish it using code behind.
This seems so basic that I'm sure I'm missing something, but I don't know what it is. I'm also not at all attached to the idea of adding a row, if there's another way to accomplish what I'm trying to do.
Thanks in advance!
For posterity, I never found a way to do this, and ultimately threw out the RadGrid entirely and implemented the required layout with a repeater control that emits a table and rows, and I just emit an extra row for the header when necessary. I remain baffled that something so relatively straightforward does not appear to be possible with the RadGrid.
精彩评论