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

NestedViewTemplate bind to collection of objects

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thom
Top achievements
Rank 1
Thom asked on 08 Jun 2011, 05:22 PM
Hello,

I have a question regarding data binding a RadGrid that is hosted in a "long" list of GridTableViews and RadGrids.

The scenarios is this:
1. We have hierarchy of 4 levels . All levels are representing by a business object that has a property holding a collection of the next level. (Let's say firstLevel->secondLevel and so on).

Example:
'class FirstLevel
{
type ID;
SecondLevel[] SecondLevels;
}'
2. The last level (forthLevel) has in it's signature 2 collections. (firstSubLevel, secondSubLevel).

Example:
'class ForthLevel
{
type ID;
FristSubLevel[] FirstSubLevels;
SecondSubLevel[] SecondSubLevels;
}'

Because displaying 5 levels as "successive" grids might be hard for a user to follow we decided the two sub-levels  to be displayed in a RadMultiPage control (just as in the RadGrid demo http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx ) . To do this,  after a long list of (DetailTables as GridTableView), we try to set the last one's  NestedViewTemplate.

The problem I am facing is that I don't seem to find a way to bind the two "sub-level" RadGrid controls to the right data. Please keep in mind that all this data is coming as a collection of business objects.

How can I achieve this ?

Thank you,
Stefan

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 14 Jun 2011, 01:59 PM
Hi Thom,

Thank you for contacting us.

Please, take a look at the attached sample on how to bind the nested grid to a collection of objects related to the parent item in the parent grid.

Hope it will prove helpful. 

Best wishes,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Thom
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or