Hi
I'm using Q3 2008 release
I have been trying to emulate the hierarchy with template demo. I am using the Northwind database. My master table contains customers in the database.
I have been able to create a NestedViewTemplate that contains a hidden label containing the primary key for the parent row. I then use this row as a control parameter in an sql data source to populate a radgrid nested inside the NestedViewTemplate with orders for the customer ( i know i could use a standard master detail table for this but because of a layout demands I need to investigate this NestedViewTemplate). I have been able to populate the nested radgrid declaratively but I would like to know how to populate it programmatically. I have played around in the detail table data bind event to try and find some way to access the controls in the NestedViewTemplate but to no avail.
I have pasted the code below for the declarative 'version' which works ok
Many thanks in advace
<
asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadGrid ID="RadGrid1" runat="server" >
<MasterTableView DataKeyNames="CustomerID" >
<ExpandCollapseColumn Visible="True">
</ExpandCollapseColumn>
<NestedViewTemplate>
<telerik:RadTabStrip runat="server" ID="TabStrip1" MultiPageID="Multipage1"
SelectedIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="Orders" PageViewID="PageView1">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat="server" ID="Multipage1" RenderSelectedPageOnly="false">
<telerik:RadPageView runat="server" ID="PageView1">
<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("CustomerID") %>'
runat="server" />
PageView 1
<telerik:RadGrid runat="server" ID="RadGrid2">
<MasterTableView DataSourceID="SqlDataSource2">
<Columns>
<telerik:GridBoundColumn DataField="OrderDate"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="Data Source=OSCAR\SQLExpress;Initial Catalog=Northwind;Integrated Security=true;"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders Where CustomerID = @CustomerID"
runat="server">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="CustomerID" />
</SelectParameters>
</asp:SqlDataSource>
</telerik:RadPageView>
</telerik:RadMultiPage>
</NestedViewTemplate>
</MasterTableView>
</telerik:RadGrid>