1
votes

Is there a way to add a 2nd header row to a DataGrid? In the row I want a DropdDownList and a Label. Right now I have a BoundColumn and a TemplateColumn in my Columns section of the grid. But adding something here will only add column, but not a header.

It should look like this:

This is my label text: dropdownlist --> first row of header
Amount          Link --> 2nd row of header
100                link1
200                link2

How could I do this?

Thanks :)

1
And why does it need to be in the DataGrid? Why not just put it before the DataGrid? - David
Yeah, that would work, but I want it in the Grid...not possible that easily? - grady
Does it have to be in the grid or can it just look like it's in the grid? Adding it before the grid with a little styling (wrapping it all in a table, even) can accomplish that just fine. Alternatively, you can ditch the grid and do a little more manual work to customize it a lot. - David
Ignore my previous post about the HeaderTemplate. That's for a single column only. I don't think you can do it with a DataGrid, but you could certainly do it with a repeater, and use the Repeater to generate a table. The easiest method would be to just pt it before. - David
I placed it right before the grid, looks nice as well...I think there was an easy way to add it :) Thanks - grady

1 Answers