i have Radgrid with 4 level, in level1 and 2 i have using SqlDatasource (drop drop)
Even RadGrid1_DetailTableDataBind i want to bingding data source of level 3 and 4.
<telerik:RadGrid ID="RadGrid1" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" runat="server" DataSourceID="SqlDataSource1" CellSpacing="0" GridLines="None">
<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="id">
<DetailTables>
<telerik:GridTableView runat="server" DataKeyNames="id2" DataSourceID="SqlDataSource2">
<DetailTables>
<telerik:GridTableView runat="server">
<DetailTables>
<telerik:GridTableView runat="server"></telerik:GridTableView>
</DetailTables>
</telerik:GridTableView>
</DetailTables>
<ParentTableRelation>
<telerik:GridRelationFields MasterKeyField="id" DetailKeyField="id_cha2"></telerik:GridRelationFields>
</ParentTableRelation>
</telerik:GridTableView>
</DetailTables>
</MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:default %>' SelectCommand="sp_getproduct" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter SessionField="month" DefaultValue="9" Name="thang" Type="Int32"></asp:SessionParameter>
<asp:QueryStringParameter QueryStringField="nsd" DefaultValue="cuongcp" Name="nsd" Type="String"></asp:QueryStringParameter>
<asp:Parameter DefaultValue="1" Name="action" Type="Int32"></asp:Parameter>
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString='<%$ ConnectionStrings:default %>' SelectCommand="sp_getproduct" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter SessionField="month" DefaultValue="9" Name="thang" Type="Int32"></asp:SessionParameter>
<asp:QueryStringParameter QueryStringField="nsd" DefaultValue="cuongcp" Name="nsd" Type="String"></asp:QueryStringParameter>
<asp:Parameter DefaultValue="2" Name="action" Type="Int32"></asp:Parameter>
</SelectParameters>
</asp:SqlDataSource>
and code behind
protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
if (e.DetailTableView.DataSourceID == "")
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
string OrderID = dataItem.GetDataKeyValue("id2").ToString();
e.DetailTableView.DataSource = GetDataTable(OrderID);
}
if (e.DetailTableView.DataSourceID == "")
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
string id = dataItem.GetDataKeyValue("id3").ToString();
e.DetailTableView.DataSource = GetDataTable_detailt(id);
}
}
but at level 4 error. plz help me, thanks in advance