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

hierarchical grid

3 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vikas
Top achievements
Rank 1
vikas asked on 26 Feb 2011, 08:39 PM

 I have requirement for hierarchal data grid. I'm binding the grid's datasource with a collection.
 Each of the item within that collection has another collection as a Property.

Is there a way to bind the grid in such a way that , it automatically takes the inner collection as datasource for DetailsTable,
whereas the outercollection as datasource for MasterTableView ?

The telerik eg., i have seen, have datasource provided exclusively for both MasterTableview as well as Detailtable and the relation between them specifed using ParentTableRelation.

In my case, i have the relation between master & detail maintained in my collection. So binding the grid in NeedDatasource event and specifying the DataMember property declaritively should work.
let me know if you think i'm missing something ,
I donot wish to maintain two different datasource , as i have lot of grid operations.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Mar 2011, 11:55 AM
Hello Vikas,

This example demonstrates RadGrid's capability to auto-generate a hierarchical representation of a mutli-table DataSet. Just set the AutogenerateHierarchy property of RadGrid to true and it will automatically generate the hierarchy based on the tables in the DataSet and their relations with one another.

Give it a try and see if it works for you.

All the best,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
vikas
Top achievements
Rank 1
answered on 02 Mar 2011, 06:24 PM
Pavlina ,
I'm not using Dataset but Collections as my datasource.So in that case , Autogenerate Hierarchy would not work as relations are not maintained in  collections  

Thanks,
Vikas

0
Pavlina
Telerik team
answered on 03 Mar 2011, 12:31 PM
Hi Vikas,

Generally you will need at least two DataSource controls to have hierarchy RadGrid. In the DetailTableDataBind event handler you can assign or configure the data sources for the detail tables in the grid. You can determine which datasource should be related to the parent GridTableView by checking the Name property, DataSourceID property (when using data source controls) or DataMember property (when not using data source controls). Refer to this article for more information.

All the best,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
vikas
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
vikas
Top achievements
Rank 1
Share this question
or