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

NestedViewTemplate with HierarchyLoadMode="ServerOnDemand"

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jan
Top achievements
Rank 1
jan asked on 19 Apr 2009, 08:58 AM
Hello,

I have a grid with NestedViewTemplate and even though the parent MasterTableViews HierarchyLoadMode is set to "ServerOnDemand", it behaves like if it was "ServerSide".

For the following (simplified) code:

<

 

MasterTableView autogeneratecolumns="False" datakeynames="IdCustomer"

 

 

datasourceid="ObjectDataSource1" HierarchyLoadMode="ServerOnDemand">

 

 

 

<NestedViewTemplate>

 

 

<fieldset style="padding:10px;">

 

 

<legend style="padding:5px;"><b>Details:</b>

 

 

</legend>

 

 

 

<asp:HiddenField ID="ctl_hiddenId" runat="server" Value='<%# Eval("IdCustomer") %>' />

 

 

 

 

 

<asp:ObjectDataSource

 

 

ID="ctl_DetailObjectDataSource" runat="server" SelectMethod="GetDetail"

 

 

TypeName="DataModel.DetailDataSource">

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="ctl_hiddenId" DefaultValue="" Name="IdCustomer"

 

 

PropertyName="Value" Type="String" />

 

 

</SelectParameters>

 

 

</asp:ObjectDataSource>

 

 

 

<table style="width: 100%;">

 

 

<tr>

 

 

<td>

 

//something here

 

</td>

 

 

<td>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

 

<asp:ListView ID="ctl_photoListView" runat="server" DataSourceID="ctl_DetailsObjectDataSource">

 

 

<LayoutTemplate>

 

 

<ul class="ThumbnailsList">

 

 

<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>

 

 

</ul>

 

 

</LayoutTemplate>

 

 

 

<ItemTemplate>

 

 

<li>

 

 

 

//something here

 

 

</li>

 

 

</ItemTemplate>

 

 

</asp:ListView>

 

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

//

 

</td>

 

 

</tr>

 

 

</table>

 

 

</fieldset>

 

 

</NestedViewTemplate>
//columns

 

</

 

MasterTableView>


It calls the GetDetail method for each row on the initial loading of whole grid (the method is called two times for each row in grid - could it be somehow set to be colled just once), and then on expanding nested template there is no more calling of this metode of the object data source.
 I need to call selecting method of my object data source only when expanding nested template - is there something else that I need to set?

Thank you
Jan

 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Apr 2009, 04:49 PM
Hi Jan,

For more information about how to have a structure resembling a standard hierarchy, which can be greatly customized, without setting hierarchical relations between the master and detail levels, refer to the following resources:
Hierarchy with Templates 
NestedView template

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
jan
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or