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

Using ShowGroupPanel with nested tables

2 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 2
Charlie asked on 09 Aug 2010, 10:00 PM
I have set up a DataSet with 3 DataTable objects using DataRelation.
The RadGridView works great, there are 2 nested tables inside each row of the main table.
We have ShowGroupPanel set to true, which allows for column grouping for each table.
Can I allow grouping for just the top level table and not for the nested, child tables?
I tried setting ShowGroupPanel to false, but it gives me the opposite of what we want.
Thank you,
Charile

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 10 Aug 2010, 06:45 AM
Hello Charlie,

 You can use DataLoading event to customize on the fly child tables. For example:

var dataControl = (GridViewDataControl)sender;
if(dataControl.ParentRow != null) // this is child table
{
   dataControl.ShowGroupPanel = false;
}

Greetings,
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
Charlie
Top achievements
Rank 2
answered on 10 Aug 2010, 02:26 PM

My solution:

using Telerik.Windows.Controls.GridView;

        private void radGridView1_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;
            if (dataControl.ParentRow != null// this is child table
            {
                dataControl.ShowGroupPanel = false;
            }
        }
Works like a charm, thanks Vlad.
Tags
GridView
Asked by
Charlie
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Charlie
Top achievements
Rank 2
Share this question
or