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

Header fo Column-Header / Header Grouping

6 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gernot
Top achievements
Rank 1
Gernot asked on 07 Jul 2008, 08:19 AM
Hello,
is it possible to create a Grid with the following structure:

Header-Grouping

Header1

Header2

Header3

Header4

 Row

Row

Row

Row



Header1 to 4 are Column-Headers. I want to create a Header-Group. I need something like colspan... Is this posible with the RadGrid?

Many Thanks for your help.




6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jul 2008, 09:26 AM
Hi,

You can use a GridTemplateColumn to achieve the desired scenario. Go through the following help article for more details.
Customizing with GridTemplateColumn

Thanks
Shinu.
0
Gernot
Top achievements
Rank 1
answered on 08 Jul 2008, 06:24 AM
Hello,
thank you for your help.

In this case the grid columns are bound columns :-(

I think you cant use item-template with bound columns.

Thanks
0
Sebastian
Telerik team
answered on 08 Jul 2008, 06:46 AM
Hi Alaeddin,

The multi-header layout you request is attainable with GridTemplateColumns only (configuring their item template/header template appearance). Hence if this customization is a prerequisite for you, consider replacing your GridBoundColumns with template columns.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Accepted
Princy
Top achievements
Rank 2
answered on 08 Jul 2008, 07:23 AM
Hi Alaeddin,

You can also have a look at the following code library submission.
span cells in grid over multiple positions

Thanks
Princy.
0
Gernot
Top achievements
Rank 1
answered on 08 Jul 2008, 07:25 AM
I will give it a try ;-)

Thank you for your great support guys ;-)
0
Ryan Means
Top achievements
Rank 1
answered on 24 Mar 2009, 08:39 PM
Here is an alternative used in a group footer example that is less difficult than the one described in the code sample span cells in grid over multiple.

 

protected void rgSnapshotGrid_ItemDataBound(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridGroupFooterItem)  
    {  
        //We assume that the total is in the last column  
        string columnGroupTotal = item.Cells[item.Cells.Count - 1].Text;  
        int cellCount = item.Cells.Count;  
 
        item.Cells.Clear();  
 
        TableCell cell = new TableCell();  
        cell.Text = String.Format("Account Subtotal: {0}", columnGroupTotal); ;  
        cell.ColumnSpan = cellCount;  
        cell.HorizontalAlign = HorizontalAlign.Right;  
 
        item.Cells.Add(cell);                  
    }  

Tags
Grid
Asked by
Gernot
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Gernot
Top achievements
Rank 1
Sebastian
Telerik team
Princy
Top achievements
Rank 2
Ryan Means
Top achievements
Rank 1
Share this question
or