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

How to Create 4 Grouped Columns in 2 Rows using RadGrid?

4 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 08 Jun 2011, 10:25 AM
I'd need to create 4 columns at runtime and they should be grouped in one header.

For example, imagine I have 4 columns of AM, PM, EVE and Full and they should all be under one header (Monday):

------------------------
      Monday
AM PM EVE Full
------------------------
1 1 1 3
2 1 1 4
1 1 1 3

I just made up the numbers to demonstrate there should be 4 columns appearing

How could I achieve this?

Many thanks,

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Jun 2011, 10:54 AM
Hello Pooya,

Check the following code library to implement this functionality.
span cells in grid over multiple positions.

Thanks,
Princy.
0
Pooya
Top achievements
Rank 1
answered on 08 Jun 2011, 05:04 PM
Hi,

Perhaps I didn't explain it clearly enough.

The Column Rows should be just appear as normal (4 columns); AM (Column 1), PM (Column 2), EVE (Column 3), FULL (Column 4)
The Column header should appear as 1 header text (Monday) over 4 texts (AM (Column 1), PM (Column 2), EVE (Column 3), FULL (Column 4) as if the 4 columns are grouped..

As above demonstration, only the header texts should be merged to appear as one.

I just realized that's called Merging Columns!

My requirement is like this: http://www.telerik.com/community/forums/aspnet-ajax/grid/merge-header-columns.aspx but the link to the Telerik GridTemplateColumn is missing.

Thanks,
0
Pooya
Top achievements
Rank 1
answered on 08 Jun 2011, 11:41 PM
I found this code for creating the GridTemplateColumn declaratively from here: http://www.telerik.com/help/aspnet/grid/grdcustomizewithgridtemplatecolumn.html

Now, I'd need to create the template columns programmatically as it will be determined at runtime which columns should be shown (Full, AM, PM or EVE), how would that be possible?

Creating HeaderTemplates and ItemTemplates at runtime?

Thanks,


0
Mira
Telerik team
answered on 13 Jun 2011, 11:42 AM
Hello Pooya,

Please examine the Creating template columns programmatically section of the Programmatic creation help topic to see how the desired functionality can be implemented.

I hope this helps.

Best wishes,
Mira
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.

Tags
Grid
Asked by
Pooya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pooya
Top achievements
Rank 1
Mira
Telerik team
Share this question
or