I have a detail table in my grid and I want to allow paging on it but it is not working. I currently have 12 records in y dataset and I have the page size set at ten, but it will only show me the first ten records and will not show me page 2 at all. If I set the page size at 2, the detail table will show only 2 records and will not page to any other page. If I set the pagesize to 20 it will show all 12 records, but then I will only be able to see the first 20 records. Basically it is not allowing me to see past the first page in the detail table.
Does anyone know what would be causing this behavior? What would be the correct pager settings for both the master table and the detail tables?
8 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2008, 10:28 AM
Hi,
What kind of paging are you using ? Sending your aspx will be more good.
Shinu.
What kind of paging are you using ? Sending your aspx will be more good.
Shinu.
0
ranro
Top achievements
Rank 1
answered on 01 Jul 2008, 10:44 PM
Shinu, here is my aspx page.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="love.aspx.cs" Inherits="Common_love" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="radW" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<script type="text/javascript">
function ShowAddForm()
{
var query="<%=Request.Url.Query%>";
var itemtype = document.getElementById('hdnItemType').value;
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("AddloveDialog");
oWnd.SetUrl("loveEntry.aspx" + query + "&itemType=" + itemtype + "&lovePK=-1&formType=Addlove");
oWnd.SetSize(500,460);
oWnd.Center;
oWnd.Show();
return false;
}
function ShowEditForm(lovePK,itemType)
{
var query="<%=Request.Url.Query%>";
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("EditloveDialog");
oWnd.SetUrl("loveEdit.aspx" + query + "&itemType=" + itemType + "&lovePK=" + lovePK);
oWnd.SetSize(450,200);
oWnd.Center;
oWnd.Show();
return false;
}
</script>
<form id="form2" runat="server">
<div id="fieldContainer" style="height:580px;width:845px;margin-left:5px;margin-right:auto;">
<div class="PageHeader" >
<asp:Hyperlink ID="lblCode" CssClass="labelText" runat="server" Text="Code:"></asp:Hyperlink>
<asp:TextBox ID="txtCode" runat="server" ReadOnly= "true" Width="202px"/>
<asp:Hyperlink ID="lblName" CssClass="labelText" runat="server" Text="Name:"></asp:Hyperlink>
<asp:TextBox ID="txtName" runat="server" ReadOnly="true" Width="202px"></asp:TextBox>
</div>
<div class="grid">
<asp:Label ID="lbllove" runat="server" Text="love" CssClass="labelText"></asp:Label>
<radG:RadGrid ID="grdlove" runat="server" OnDetailTableDataBind="grdlove_DetailTableDataBind" OnNeedDataSource="grdlove_NeedDataSource"
GridLines="Both" EnableOutsideScripts="True" EnableAJAX="true" OnDeleteCommand="grdlove_DeleteCommand"
OnItemCreated="grdlove_ItemCreated" PageSize="10" PagerStyle-AlwaysVisible="true" AllowPaging="true" AutoGenerateColumns="false" >
<PagerStyle Mode="NextPrevAndNumeric" />
<ClientSettings EnableClientKeyValues="True" ReorderColumnsOnClient="true" AllowColumnsReorder="true">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight= "400px" />
<Resizing AllowColumnResize="True" />
<ClientEvents />
</ClientSettings>
<MasterTableView Name="love" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Left" DataKeyNames="love_pk,love_itemType_fk" ShowFooter="false" >
<DetailTables>
<radG:GridTableView DataKeyNames="record_pk" DataMember="f_record" runat="server" ShowHeader="true" ShowFooter="false" Name="record" Width="75%" GridLines="Both">
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="record_love_fk" MasterKeyField="love_pk" />
</ParentTableRelation>
<Columns>
<radG:GridBoundColumn DataField="record_value" UniqueName="record_value" HeaderText="Reading" ReadOnly="true">
<ItemStyle Width="100px" />
<HeaderStyle Width="100px" />
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="record_dateLocal" UniqueName="record_dateLocal" HeaderText="Reading Date" ReadOnly="true">
<ItemStyle Width="150px "/>
<HeaderStyle Width="150px" />
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="wk_displayName" UniqueName="wk_displayName" HeaderText="Taken By" Display="True">
<ItemStyle Width="100px" />
<HeaderStyle Width="100px" />
</radG:GridBoundColumn>
</Columns>
<NoRecordsTemplate>No Records</NoRecordsTemplate>
</radG:GridTableView>
</DetailTables>
<Columns>
<radg:GridTemplateColumn UniqueName="Edit" Display="False">
<ItemTemplate>
<asp:HyperLink ID="EditLink" runat="server" Text="Edit" ImageUrl ="../RadControls/Grid/Skins/Office2007/Edit.gif"></asp:HyperLink>
</ItemTemplate>
<HeaderStyle Width="25px" />
<ItemStyle Width="25px" />
</radg:GridTemplateColumn>
<radG:GridButtonColumn ConfirmText="Are you sure you want to delete this love?" UniqueName="Delete" CommandName="Delete" Display="False" ButtonType="ImageButton" ImageUrl="../RadControls/Grid/Skins/Office2007/Delete.gif">
<ItemStyle Width="25px"/>
<HeaderStyle Width="25px" />
</radG:GridButtonColumn>
<radG:GridBoundColumn HeaderText="love Name" HeaderStyle-HorizontalAlign="Center" DataField="love_name" ReadOnly="True" UniqueName="love_name" />
<radG:GridBoundColumn HeaderText="Love Number" HeaderStyle-HorizontalAlign="Center" DataField="record_value" ReadOnly="True" UniqueName="record_value" />
<radG:GridBoundColumn HeaderText="Love Date" HeaderStyle-HorizontalAlign="Center" DataField="record_dateLocal" ReadOnly="True" UniqueName="record_dateLocal" >
<ItemStyle Width="150px"/>
<HeaderStyle Width="150px" />
</radG:GridBoundColumn>
</Columns>
<CommandItemTemplate>
<asp:Image ID="Addlove" runat="server" ImageUrl="~/RadControls/Grid/Skins/Office2007/AddRecord.gif" AlternateText="Add Department" />
<a href="#" onclick="return ShowAddForm();">Add love</a>
</CommandItemTemplate>
<ExpandCollapseColumn Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</MasterTableView>
<ItemStyle Wrap="False" />
<HeaderStyle Wrap="False" />
</radG:RadGrid>
</div>
</div><!--end fieldContainer//-->
<div id="noDisplay">
<asp:HiddenField ID="hdnItemType" runat="server" />
<radA:RadAjaxManager ID="PageAjaxManager" runat="server">
<AjaxSettings>
<radA:AjaxSetting AjaxControlID="grdlove">
<UpdatedControls>
<radA:AjaxUpdatedControl ControlID="grdlove" />
</UpdatedControls>
</radA:AjaxSetting>
</AjaxSettings>
</radA:RadAjaxManager>
<radW:RadWindowManager ID="PageAjaxWindowManager" runat="server">
<Windows>
<radw:RadWindow ID="AddloveDialog" runat="server" Title="Add love Dialog"
ReloadOnShow="true" Modal="true" Skin="Office2007" />
<radw:RadWindow ID="EditloveDialog" runat="server" Title="Edit love Dialog"
ReloadOnShow="true" Modal="true" Skin="Office2007" />
</Windows>
</radW:RadWindowManager>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="love.aspx.cs" Inherits="Common_love" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="radW" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<script type="text/javascript">
function ShowAddForm()
{
var query="<%=Request.Url.Query%>";
var itemtype = document.getElementById('hdnItemType').value;
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("AddloveDialog");
oWnd.SetUrl("loveEntry.aspx" + query + "&itemType=" + itemtype + "&lovePK=-1&formType=Addlove");
oWnd.SetSize(500,460);
oWnd.Center;
oWnd.Show();
return false;
}
function ShowEditForm(lovePK,itemType)
{
var query="<%=Request.Url.Query%>";
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("EditloveDialog");
oWnd.SetUrl("loveEdit.aspx" + query + "&itemType=" + itemType + "&lovePK=" + lovePK);
oWnd.SetSize(450,200);
oWnd.Center;
oWnd.Show();
return false;
}
</script>
<form id="form2" runat="server">
<div id="fieldContainer" style="height:580px;width:845px;margin-left:5px;margin-right:auto;">
<div class="PageHeader" >
<asp:Hyperlink ID="lblCode" CssClass="labelText" runat="server" Text="Code:"></asp:Hyperlink>
<asp:TextBox ID="txtCode" runat="server" ReadOnly= "true" Width="202px"/>
<asp:Hyperlink ID="lblName" CssClass="labelText" runat="server" Text="Name:"></asp:Hyperlink>
<asp:TextBox ID="txtName" runat="server" ReadOnly="true" Width="202px"></asp:TextBox>
</div>
<div class="grid">
<asp:Label ID="lbllove" runat="server" Text="love" CssClass="labelText"></asp:Label>
<radG:RadGrid ID="grdlove" runat="server" OnDetailTableDataBind="grdlove_DetailTableDataBind" OnNeedDataSource="grdlove_NeedDataSource"
GridLines="Both" EnableOutsideScripts="True" EnableAJAX="true" OnDeleteCommand="grdlove_DeleteCommand"
OnItemCreated="grdlove_ItemCreated" PageSize="10" PagerStyle-AlwaysVisible="true" AllowPaging="true" AutoGenerateColumns="false" >
<PagerStyle Mode="NextPrevAndNumeric" />
<ClientSettings EnableClientKeyValues="True" ReorderColumnsOnClient="true" AllowColumnsReorder="true">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight= "400px" />
<Resizing AllowColumnResize="True" />
<ClientEvents />
</ClientSettings>
<MasterTableView Name="love" CommandItemDisplay="Top" CommandItemStyle-HorizontalAlign="Left" DataKeyNames="love_pk,love_itemType_fk" ShowFooter="false" >
<DetailTables>
<radG:GridTableView DataKeyNames="record_pk" DataMember="f_record" runat="server" ShowHeader="true" ShowFooter="false" Name="record" Width="75%" GridLines="Both">
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="record_love_fk" MasterKeyField="love_pk" />
</ParentTableRelation>
<Columns>
<radG:GridBoundColumn DataField="record_value" UniqueName="record_value" HeaderText="Reading" ReadOnly="true">
<ItemStyle Width="100px" />
<HeaderStyle Width="100px" />
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="record_dateLocal" UniqueName="record_dateLocal" HeaderText="Reading Date" ReadOnly="true">
<ItemStyle Width="150px "/>
<HeaderStyle Width="150px" />
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="wk_displayName" UniqueName="wk_displayName" HeaderText="Taken By" Display="True">
<ItemStyle Width="100px" />
<HeaderStyle Width="100px" />
</radG:GridBoundColumn>
</Columns>
<NoRecordsTemplate>No Records</NoRecordsTemplate>
</radG:GridTableView>
</DetailTables>
<Columns>
<radg:GridTemplateColumn UniqueName="Edit" Display="False">
<ItemTemplate>
<asp:HyperLink ID="EditLink" runat="server" Text="Edit" ImageUrl ="../RadControls/Grid/Skins/Office2007/Edit.gif"></asp:HyperLink>
</ItemTemplate>
<HeaderStyle Width="25px" />
<ItemStyle Width="25px" />
</radg:GridTemplateColumn>
<radG:GridButtonColumn ConfirmText="Are you sure you want to delete this love?" UniqueName="Delete" CommandName="Delete" Display="False" ButtonType="ImageButton" ImageUrl="../RadControls/Grid/Skins/Office2007/Delete.gif">
<ItemStyle Width="25px"/>
<HeaderStyle Width="25px" />
</radG:GridButtonColumn>
<radG:GridBoundColumn HeaderText="love Name" HeaderStyle-HorizontalAlign="Center" DataField="love_name" ReadOnly="True" UniqueName="love_name" />
<radG:GridBoundColumn HeaderText="Love Number" HeaderStyle-HorizontalAlign="Center" DataField="record_value" ReadOnly="True" UniqueName="record_value" />
<radG:GridBoundColumn HeaderText="Love Date" HeaderStyle-HorizontalAlign="Center" DataField="record_dateLocal" ReadOnly="True" UniqueName="record_dateLocal" >
<ItemStyle Width="150px"/>
<HeaderStyle Width="150px" />
</radG:GridBoundColumn>
</Columns>
<CommandItemTemplate>
<asp:Image ID="Addlove" runat="server" ImageUrl="~/RadControls/Grid/Skins/Office2007/AddRecord.gif" AlternateText="Add Department" />
<a href="#" onclick="return ShowAddForm();">Add love</a>
</CommandItemTemplate>
<ExpandCollapseColumn Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</MasterTableView>
<ItemStyle Wrap="False" />
<HeaderStyle Wrap="False" />
</radG:RadGrid>
</div>
</div><!--end fieldContainer//-->
<div id="noDisplay">
<asp:HiddenField ID="hdnItemType" runat="server" />
<radA:RadAjaxManager ID="PageAjaxManager" runat="server">
<AjaxSettings>
<radA:AjaxSetting AjaxControlID="grdlove">
<UpdatedControls>
<radA:AjaxUpdatedControl ControlID="grdlove" />
</UpdatedControls>
</radA:AjaxSetting>
</AjaxSettings>
</radA:RadAjaxManager>
<radW:RadWindowManager ID="PageAjaxWindowManager" runat="server">
<Windows>
<radw:RadWindow ID="AddloveDialog" runat="server" Title="Add love Dialog"
ReloadOnShow="true" Modal="true" Skin="Office2007" />
<radw:RadWindow ID="EditloveDialog" runat="server" Title="Edit love Dialog"
ReloadOnShow="true" Modal="true" Skin="Office2007" />
</Windows>
</radW:RadWindowManager>
</div>
</form>
</body>
</html>
0
Shinu
Top achievements
Rank 2
answered on 02 Jul 2008, 06:33 AM
Hi,
Try setting the EnableAjax property for the Grid to false and see whether Paging is working properly.
ASPX:
Shinu.
Try setting the EnableAjax property for the Grid to false and see whether Paging is working properly.
ASPX:
<radG:RadGrid ID="grdlove" runat="server" EnableAJAX="False" OnDetailTableDataBind="grdlove_DetailTableDataBind" OnNeedDataSource="grdlove_NeedDataSource" |
GridLines="Both" EnableOutsideScripts="True" > |
Shinu.
0
ranro
Top achievements
Rank 1
answered on 02 Jul 2008, 01:17 PM
Shinu,
Thanks for your reply. I tried doing what you suggested and set the EnableAjax property to "false", however the paging the the detail table still does not work.
Thanks for your reply. I tried doing what you suggested and set the EnableAjax property to "false", however the paging the the detail table still does not work.
0
Shinu
Top achievements
Rank 2
answered on 03 Jul 2008, 05:54 AM
Hi Ranro,
Are you able to do paging properly with the MasterTable?
Shinu.
Are you able to do paging properly with the MasterTable?
Shinu.
0
ranro
Top achievements
Rank 1
answered on 05 Jul 2008, 04:05 AM
Yes paging in the master table works just like it is supposed to, however paging does not work in the detail tables.
0
Princy
Top achievements
Rank 2
answered on 05 Jul 2008, 05:59 AM
Hi Ranro,
Can you try setting the Paging in the Detail table and see whether it is working?
ASPX:
Thanks
Princy.
Can you try setting the Paging in the Detail table and see whether it is working?
ASPX:
<DetailTables > |
<telerik:GridTableView Name="Detail" AllowPaging="true" PageSize="5" DataSourceID="SqlDataSource1" > |
Thanks
Princy.
0
ranro
Top achievements
Rank 1
answered on 07 Jul 2008, 09:04 PM
Princy,
Thanks for your reply. I tried allowing paging in the detail table and this did not work.
Thanks for your reply. I tried allowing paging in the detail table and this did not work.