I am trying to paging for detail table in RadGrid. but when i click on page's it is getting back to grid bind.
My code is :-
<telerik:RadGrid ID="rdSettings" runat="server" AllowPaging="true" width="100%" AutoGenerateColumns="false"
OnDetailTableDataBind="rdSettings_DetailTableDataBind" Skin="Metro" OnPageIndexChanged="rdSettings_PageIndexChanged" OnPageSizeChanged="rdSettings_PageSizeChanged" Visible="false">
<MasterTableView DataKeyNames="Module">
<DetailTables>
<telerik:GridTableView Name="group" Width="100%" AutoGenerateColumns="false">
<Columns>
<telerik:GridTemplateColumn ItemStyle-Width="5%">
<ItemTemplate>
<asp:CheckBox ID="chkGroup" runat="server" AutoPostBack="true" OnCheckedChanged="chkGroup_CheckedChanged"/>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="groupname" UniqueName="groupname" HeaderText="Group" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridTemplateColumn HeaderText="Select">
<HeaderTemplate>
<asp:CheckBox ID="chkHeader" AutoPostBack="true" runat="server" OnCheckedChanged="chkHeader_CheckedChanged" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkmodule" runat="server" OnCheckedChanged="chkmodule_CheckedChanged" AutoPostBack="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Module" UniqueName="Module" HeaderText="Module" ItemStyle-Width="85%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
And Detail Table code is
protected void rdSettings_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) // Bind's the nested Grid for Page Settings
{
string groupname = "";
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "group":
{
groupname = dataItem.GetDataKeyValue("Module").ToString();
string sqlquery = "select distinct(groupname) from [dbo].[POColumns] where module= '" + groupname + "'";
SqlDataAdapter da = new SqlDataAdapter(sqlquery, ScrCon);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
e.DetailTableView.DataSource = ds;
}
break;
}
}
}
Please help out what else i have to do get the paging in Detail Table
My code is :-
<telerik:RadGrid ID="rdSettings" runat="server" AllowPaging="true" width="100%" AutoGenerateColumns="false"
OnDetailTableDataBind="rdSettings_DetailTableDataBind" Skin="Metro" OnPageIndexChanged="rdSettings_PageIndexChanged" OnPageSizeChanged="rdSettings_PageSizeChanged" Visible="false">
<MasterTableView DataKeyNames="Module">
<DetailTables>
<telerik:GridTableView Name="group" Width="100%" AutoGenerateColumns="false">
<Columns>
<telerik:GridTemplateColumn ItemStyle-Width="5%">
<ItemTemplate>
<asp:CheckBox ID="chkGroup" runat="server" AutoPostBack="true" OnCheckedChanged="chkGroup_CheckedChanged"/>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="groupname" UniqueName="groupname" HeaderText="Group" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridTemplateColumn HeaderText="Select">
<HeaderTemplate>
<asp:CheckBox ID="chkHeader" AutoPostBack="true" runat="server" OnCheckedChanged="chkHeader_CheckedChanged" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkmodule" runat="server" OnCheckedChanged="chkmodule_CheckedChanged" AutoPostBack="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Module" UniqueName="Module" HeaderText="Module" ItemStyle-Width="85%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
And Detail Table code is
protected void rdSettings_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) // Bind's the nested Grid for Page Settings
{
string groupname = "";
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "group":
{
groupname = dataItem.GetDataKeyValue("Module").ToString();
string sqlquery = "select distinct(groupname) from [dbo].[POColumns] where module= '" + groupname + "'";
SqlDataAdapter da = new SqlDataAdapter(sqlquery, ScrCon);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
e.DetailTableView.DataSource = ds;
}
break;
}
}
}
Please help out what else i have to do get the paging in Detail Table