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