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

Binding GridView to heirarchical collection

2 Answers 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 29 Mar 2010, 09:44 PM
I have a collection of say invoices that has a collection of invoice details or line items and a collection of payements.  I want to bind the gridview to the collection without manually creating all of the columns and such.  When I use the Invoice collection as the datasource I do not get the children of invoice, only the single column.  I am setting autoGenerateHeirarchy.  Do I need to define the relationships to accomplish this, even though they are well defined already?

Thanks




2 Answers, 1 is accepted

Sort by
0
Tim Weckx
Top achievements
Rank 1
answered on 31 Mar 2010, 07:39 PM
The AutoGenerateHierarchy property only works for datasets that have relationships defined between datatables.

More info can be found in the WinForms - GridView documentation: http://www.telerik.com/help/winforms/grid_binding-to-hierarchical-data-automatically.html
0
Julian Benkov
Telerik team
answered on 01 Apr 2010, 01:17 PM
Hello Matt,

The auto generate mechanism of RadGridView currently works only with a DataSet object. You must set DataSource to your DataSet object and DataMember to the root Table, in your case DataMember = "Invoices". Your DataSet also must define relations between the inner Tables.

As Tim has suggested, you can find additional information in our online documentation.

Sincerely yours,

Julian Benkov
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
Matt
Top achievements
Rank 1
Answers by
Tim Weckx
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or