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

Hierarchy structure and presentation questions

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 30 Jun 2010, 12:52 AM
Hi,

I have a dataset consisting of three tables.

Table 0 has a single row
Table 1 has multiple rows
Table 2 has multiple rows

All 3 tables have a common OrderID integer key that joins the data and we are using DataKeyNames="OrderID"
for the mastertableview as well as the detail tables.

What I would like is an indented presentation of these rows

Table 0 - Order Info
              Table 1 - Product 1
              Table 1 - Product 2
              Table 1 - Product 3
                            Table 2 - Payment 1
                            Table 2 - Payment 2

etc.

What I have working right now is a grid that keeps repeating the top row (table 0), and is quite inefficient in its presentation. An order with 4 items will repeat many of these rows. Its confusing and redundant. How can I get the grid to display in a more nested fashion with this type of data?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 01 Jul 2010, 04:50 PM
Hello Karl,

The desired hierarchy structure can be presented in RadGrid through parent table relations or DetailTableDataBind event handling. You can generate the content for each table in the grid structure and populate it with data in par with the relations in the grid source. 

Detailed information about this common type of Telerik RadGrid hierarchy you can find in the Populating the control with data chapter (topics Advanced Databinding (using NeedDataSource event) and Hierarchical data-binding using DetailTableDataBind event) as well as in these online examples:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Hierarchy/DeclarativeRelations/DefaultCS.aspx
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Programming/DetailTableDataBind/DefaultCS.aspx

I hope this helps.

Regards,
Pavlina
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
Grid
Asked by
Karl Wilkens
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or