7 Answers, 1 is accepted
In case you are using a NestedViewTemplate and you want to add TableViews in it you can add RadGrid controls in it. Otherwise you can use multiple GridTableView and NestedTableViews on the same level as follow.
<
MasterTableView
>
<
NestedViewTemplate
>
<
telerik:RadGrid
ID
=
"InnerRadGrid"
>
</
telerik:RadGrid
>
</
NestedViewTemplate
>
<
DetailTables
>
<
telerik:GridTableView
Name
=
"FirstTableView"
>
</
telerik:GridTableView
>
<
telerik:GridTableView
Name
=
"SecondTableView"
>
</
telerik:GridTableView
>
</
DetailTables
>
I hope this information helps.
Regards,
Kostadin
Telerik
Please excuse me for misleading you in my previous reply. You are correct you can not use NestedViewTemplate and detail GridTableView on a same level. Nevertheless, you can either use multiple GridTableView or use single NestedViewTemplate with multiple RadGrid controls in it. This way you can achieve your requirement.
Regards,
Kostadin
Telerik
I tried below, but it displays data from only first <div> (--Details from parent data source), not from other two GridTableView
</NestedViewTemplate>
<div>
<table >
-- Details from parent data source
</table>
</div>
<telerik:GridTableView Datasourceid="TestA">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="" MasterKeyField="" />
</ParentTableRelation>
<Columns>
-- Details from TestA datasource
</Columns>
</telerik:GridTableView>
<telerik:GridTableView DataSourceID ="TestB" >
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="AssetId" MasterKeyField="AssetId" />
</ParentTableRelation>
<Columns >
-- Details from TestB datasource
</Columns>
</telerik:GridTableView>
</NestedViewTemplate>
Note that you need to use a RadGrid control and not GridTableView. Please check out the following live example which demonstrates a similar scenario.
Regards,
Kostadin
Telerik
That doesn't work either. as soon as you put <ParentTableRelation> , it doesn't display data from grid
</telerik:RadGrid>
<MasterTableView>
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="" MasterKeyField="" />
</ParentTableRelation>
<Columns>
<telerik:GridTemplateColumn HeaderText="">
<ItemTemplate>
<table>
<tr>
<td><%# Eval("Name").ToString()%></td>
</tr>
</table>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Note that ParentTableRelation is applicable only when using a DetailTables. In case you are using a NestedViewTemplate you can get the ID of the parent dataitem and based on it to retrieve the data. If you examine the previously provided live example you will noticed that we are using a Label control which holds the EmployeeID of each parent row. Based on the id we filter the datasource and populate the child RadGrid. You can use similar approach for your project.
Regards,
Kostadin
Telerik