This is a migrated thread and some comments may be shown as answers.

RadGrid - Add Subheader

1 Answer 269 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sija
Top achievements
Rank 1
Sija asked on 23 Jan 2009, 09:07 AM
Hi,

I want to add a 2nd header row to my radgrid header. I am using Q3 2007 version. I know i can add a new row to header in gridview by inserting a GridViewRow object as shownbelow (inside ItemDataBound event of grid)

GridViewRow gvr = e.Row;
switch (gvr.RowType)
{
case DataControlRowType.HeaderRow:
{

GridViewRow row = new GridViewRow(0, 0, DataControlRowType.DataRow, DataControlRowState.Normal);
TableCell cell = new TableCell();
cell.BackColor = Color.Red;
cell.ForeColor = Color.White;
cell.ColumnSpan = GridView1.Columns.Count;
cell.HorizontalAlign = HorizontalAlign.Center;
cell.Text = subcategory;
row.Cells.Add(cell);

GridView1.Controls[0].Controls.AddAt(0, row);

break;
}
}

How can I do this in Radgrid? I tried replicating the process using GridDataItem, but teh row didn't show up on the grid.  
 
My grid columns are created dynamically; the count is not known before. There's grouping happening inside the grid too.
Please help. This is a very urgent & critical one.

Thanks,
Sija

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Jan 2009, 02:38 PM
Hello Sija,

I suggest you examine the following links:
Column types demo
Multi-header columns/merged cells with template columns
Span cells over multiple columns

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Sija
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or