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

[Solved] NestedViewTemplate & Grid - Programmatic Example?

3 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
brianmic
Top achievements
Rank 1
brianmic asked on 04 Sep 2009, 06:25 PM
Hi All,
I am looking for an example to creating a Grid, with child records displayed in a NestedViewTemplate & grid within that.. I know there is the .aspx example, but I am trying to rewrite to go into a SharePoint webpart, therefore need to rewrite it C# and am close to having it working, having parent child relationship problems. Anyone have any good examples?

-Brian

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Sep 2009, 12:06 PM
Hi Brian,

Here is a help article which explains about the Progrmmatic creation of RadGrid. Go through it and see if it helps to some extent.
Programmatic creation

Shinu


0
brianmic
Top achievements
Rank 1
answered on 15 Sep 2009, 07:04 PM
Hi Shinu,
The master/detail programmatic creation of the radgrid is fairly easy. It's the Nested Template View and setting up the relations between the parent grid and the detailed nested view that is more complicated when doing it completely via code and no aspx. I just started revisiting this today, along with revisiting from elevated frustration level.

-Brian
0
Iana Tsolova
Telerik team
answered on 18 Sep 2009, 02:17 PM
Hello brianmic,

In order to achieve your goal, you should first define your own class inhering from ItemTemplate. It would be used for the NestedViewTemplate when creating the grid.

Regarding the data-bind problem: I suggest that you bind both grids through the NeedDataSource event. For the outer grid there is nothing specific, you can do it as for a regular grid. And in the inner grid NeedDataSource event, you can get reference to the outer grid expanded item, e.g. the parent item. Thus you can get a data field value of the expanded item and use it for retrieving the inner grid data source.

Let me know if this helps and if further questions arise.

Sincerely yours,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
brianmic
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
brianmic
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or