Hi
I'm using the telerik RadGrid. What I want to do is to add a row in the header of the grid to group the columns which has checboxes in it.
Currently I have the columns as GridCheckbox column in the masterview table.
Example:
<MasterTableView >
<Columns>
<telerik:GridCheckBoxColumn DataField="1" HeaderText="1" />
<telerik:GridCheckBoxColumn DataField="2" HeaderText="2" />
<telerik:GridCheckBoxColumn DataField="3" HeaderText="3" />
All I want to do is just add a customer header that show two or more column headers grouped togeather. I don't need to group any data.
like
header 1: group Header
header 2: 1 2 3
and then the values of the columns 1 2 and 3 in check boxes
How can i do this?
Does anyone have any idea?
4 Answers, 1 is accepted

protected void rg_PreRender(object sender, EventArgs e) |
{ |
//get the current header |
GridItem[] header = rg.MasterTableView.GetItems(GridItemType.Header); |
//get the current THead element |
GridTHead head = ((GridTHead)header[0].Parent.Controls[0].Parent); |
//Get the GridHeaderItem from the THead |
GridHeaderItem currentHeaderItem = (GridHeaderItem)head.Controls[0]; |
//Clear all GridHeaderItems |
head.Controls.Clear(); |
//create a new GridHeaderItem which will be the new row |
GridHeaderItem newHeaderItem = new GridHeaderItem(rg.MasterTableView, 0, 0); |
/* My specific implementation for adding new row |
newHeaderItem.Cells.Add(new GridTableHeaderCell() { Text = " " }); |
newHeaderItem.Cells.Add(new GridTableHeaderCell() { Text = " " }); |
newHeaderItem.Cells.Add(new GridTableHeaderCell() { Text = " ", Width = new Unit(230, UnitType.Pixel) }); |
for (int i = 0; i < statuses.Count; i++) |
{ |
Entities.AssessmentStatus status = statuses[i]; |
GridTableHeaderCell cell = new GridTableHeaderCell() |
{ |
Text = status.Name, |
ColumnSpan = 2, |
HorizontalAlign = HorizontalAlign.Center |
}; |
if (i != statuses.Count - 1) |
cell.Width = new Unit(145, UnitType.Pixel); |
newHeaderItem.Cells.Add(cell); |
} |
*/ |
//Add back the GridHeaderItems in the order you want them to appear |
head.Controls.Add(newHeaderItem); |
head.Controls.Add(currentHeaderItem); |
} |
We are glad you have found the answer in another forum post.
Do not hesitate to contact Telerik Support if future issues arise.
Regards,
Maria Ilieva
the Telerik team

Doesn't help anyone else out that may need the same info.
I suppose that the useful forum is the below one:
http://www.telerik.com/community/forums/aspnet-ajax/grid/adding-multiple-header-rows-at-runtime-in-radgrid.aspx
Greetings,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.