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

GroupHeaderTemplate issues with multiple groups

2 Answers 4 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 27 Jan 2015, 01:08 PM
Hi,

I have been struggling with some of the grouping mechanisms.  The documentation really isn't that great on this and could do with some more examples.

Take the example of multiple levels of grouping on this page: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/grouping/grouping/defaultvb.aspx?show-source=true

How do you add a custom GroupHeaderTemplate to this page.  If you do it the way that is described in the documentation it crashes.  Why?  Because in the example there are two levels of grouping.  The GroupHeaderTemplate docs only cater for one template while there can be multiple groups.  

Pulling my hair out on this one!

Any pointers

Regards

Jon

2 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 30 Jan 2015, 09:18 AM
Hello Jon,

Note that in the GroupHeaderTemplate you are setting all the templates that need to be disaply for each field that is grouped. For instance when you try the sample from the topic initially you have only one group that groups the UnitsInStock field. If you group by another field for instance ProductName it will add this template as well. I test the sample and on my side seems to work correctly. Could you please let me know whether you have received any exception on your end?

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jon
Top achievements
Rank 1
answered on 30 Jan 2015, 09:23 AM
Hi Kostadin

Thanks for that.  In the end I created a couple of functions to handle the Text and Visible elements.  Doing them in the aspx just ended up with exceptions being thrown thanks to the missing data.  So the functions simply detect which of the two groups is in use and respond accordingly.

Regards

Jon
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Jon
Top achievements
Rank 1
Share this question
or