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

Hireachial Grid with Collection.

1 Answer 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Krishna
Top achievements
Rank 1
Krishna asked on 01 Oct 2008, 03:43 PM
Hi,

I am using RadGrid for WPF. I am binding a Collection Class with out using dataset..

Can anybody help me to do...

Problem Iam Facing : When i define parent filed "GridViewDataColumn", I not able to define child filed "GridViewDataColum"

 

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 02 Oct 2008, 08:05 AM
Hi Krishna,

To enable hierarchy mode of the RadGridView control you have to define a ChildTableDefinition and add it to ChildTableDefinition collection of the RadGridView.TableDefinition.

            GridViewTableDefinition detailDefinition = new GridViewTableDefinition();
            detailDefinition.Relation = new PropertyRelation("Orders");
            radGridView1.TableDefinition.ChildTableDefinitions.Add(detailDefinition);
            radGridView1.ItemsSource = BuildCustomers();

GridViewDataColumns for the child grid will be created according to the information within the ChildTableDefinition object.

This code snippet above is taken from the "Property Hierarchy" examle. Take a look at the "Property Hierarchy" and the "Custom Hierarchy" examples available at http://demos.telerik.com/wpf/ and in your offline sample apps. They contain the working code for a scenario that looks identical to yours.

For details on creating hierarchy you can go through the http://www.telerik.com/help/wpf/gridview-fundamentals-hierarchical.html help topic.

Hope this will help.

Regards,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Krishna
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or