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

Show column headers in hierarchical way

5 Answers 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan Dobrovolny
Top achievements
Rank 1
Stefan Dobrovolny asked on 21 Apr 2010, 08:45 AM
Hello,

  I am looking for a way how to show the grid column headers in a hierarchical way (for example the top level would be year and lower level would be quarters then months and so on (as shown in attached jpg)).
 
  The data I am trying to display are already flattened in my VM to the column header hierarchy lowest level - so only the lowest level acts as the "real" column headers. I just need the higher levels to be data-bound, displayed and aligned in the headers section.
 
  Any pointer how to achieve this would be appreciated.

  Thanks, Stefan

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2010, 08:48 AM
Hello Stefan,

Please check this blog post for more info on how to achieve this.

Sincerely yours,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Stefan Dobrovolny
Top achievements
Rank 1
answered on 21 Apr 2010, 11:42 AM
Thanks Vlad, 

  That is almost what I needed. 
  Would it be possible to use more than one level of grouping using the described technique?

~Stefan
0
Pavel Pavlov
Telerik team
answered on 23 Apr 2010, 02:17 PM
Hello Stefan Dobrovolny,

It gets more complicated but I think it is achievable. Can you please attach a picture of the desired output so I can try prepare a small sample for you ?

Regards,
Pavel Pavlov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Stefan Dobrovolny
Top achievements
Rank 1
answered on 30 Apr 2010, 09:35 AM
Hi Pavel, 

  What I'd like to achieve is to having headers behave as they do in the OLAP grids: 

  I have the hierarchy (hierarchical structure) of items and I would like to show the hierarchy as the column headers.
  The data inside the grid are "bound" only to the "leaves" of the hierarchy and any other logic is handled in code behind. 

Best regards, Stefan
0
Pavel Pavlov
Telerik team
answered on 03 May 2010, 10:32 AM
Hello Stefan Dobrovolny,

Ok , indeed this gets a bit beyond the capabilities of RadGridView. Actually there has been an increasing demand for such feature lately so we are planning  either  a new control ( kind of pivot grid) , or extending the current RadGridView to cover such scenarios.

As I said such behavior is achievable even with the current version of RadGridView, but the hierarchy-header logic should be manually implemented in a user control which later can be placed above the regular header. The code will be complicated and hard to maintain. In case you have fixed column widths and turn off the column resizing - this may simplify the code.

With these thoughts in mind I would recommend to carefully reconsider whether you want to go that way.

Greetings,
Pavel Pavlov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Stefan Dobrovolny
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Stefan Dobrovolny
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or