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

Grouping in child template

5 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jarek Rutowicz
Top achievements
Rank 1
Jarek Rutowicz asked on 23 Sep 2009, 12:54 PM
Welcome,
I have a problem with grouping colums in child templates.

this.radGridViewMachines.EnableGrouping = true
this.radGridViewMachines.AllowDrop = true
this.radGridViewMachines.MasterGridViewTemplate.AllowDragToGroup = true
this.radGridViewMachines.MasterGridViewTemplate.EnableGrouping = true
 
templateWarehouse.EnableGrouping = true
templateWarehouse.AllowDragToGroup = true

What else I have to do to turn on grouping in templateWahouse?
Jarek.


5 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 24 Sep 2009, 02:49 PM
Hi Jarek Rutowicz,

You should only set the EnableGrouping property to true. This should be enough. You can add grouping by code. Here is a sample:

templateWarehouse.GroupByExpressions.Add("Value GroupBy Value"); 

Please describe the issue in more details. This will help me to find a proper solution for you. I am looking forward to your reply.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jarek Rutowicz
Top achievements
Rank 1
answered on 24 Sep 2009, 08:53 PM
Well, I can't make it work.
I've made a simple app to describe the problem:

DataClasses1DataContext db = new DataClasses1DataContext(); 
            this.bindingSource1.DataSource = from MachineGroupsView m in db.MachineGroupsViews select m; 
            this.bindingSource2.DataSource = from WarehouseDetailsView w in db.WarehouseDetailsViews select w; 
 
            this.radGridView1.DataSource = this.radGridView1.DataSource = this.bindingSource1; 
             
            GridViewTemplate templateChild = new GridViewTemplate(); 
            templateChild.DataSource = this.bindingSource2; 
            templateChild.EnableGrouping = true
            this.radGridView1.MasterGridViewTemplate.ChildGridViewTemplates.Add(templateChild); 
 
            GridViewRelation relation = new GridViewRelation(); 
            relation.ChildTemplate = templateChild; 
            relation.ParentTemplate = this.radGridView1.MasterGridViewTemplate; 
            relation.ChildColumnNames.Add("idWarehouse"); 
            relation.ParentColumnNames.Add("idWarehouse"); 
 
            this.radGridView1.Relations.Add(relation); 
            this.radGridView1.EnableGrouping = true

Hierarchy works ok, but grouping works olny in MasterGridViewTemplate. I need it to work in templateChild.
Thank you for your replies.



0
Jack
Telerik team
answered on 26 Sep 2009, 06:12 AM
Hi Jarek Rutowicz,

This code seems to be OK. However, I don't see code that makes the grouping. You should do this by adding group expression or by using the UI. Please describe how do you make the grouping. It will help if you send me your application. This way I will be able to investigate this case further and find a proper solution.

I am looking forward to your reply.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jarek Rutowicz
Top achievements
Rank 1
answered on 26 Sep 2009, 10:59 AM
OK:)
I've thought that child template would have his own row where I should drag columns. Now I understand that I shoud drog columns to main GridView.

Thank you for Replies, Jarek.
0
Jack
Telerik team
answered on 28 Sep 2009, 12:06 PM
Hi Jarek,

I am glad to hear that you have found a solution for the issue. If you have more questions, don't hesitate to ask.

Kind regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Jarek Rutowicz
Top achievements
Rank 1
Answers by
Jack
Telerik team
Jarek Rutowicz
Top achievements
Rank 1
Share this question
or