
prathyusha
Top achievements
Rank 1
prathyusha
asked on 12 Dec 2011, 08:44 PM
Hi
I have one problem
In my grid I set pagesize =10
I added 11 records
It was showing in 2 pages.
When I removed 11th record from second page, It is not pointing to first oage whihc has values.
It is showing 2nd page and saying that , there are no records to display.
Could you please help me to resolve this issue.
I really appreciate , if some one helps me regarding this.
Thanks
Usha
I have one problem
In my grid I set pagesize =10
I added 11 records
It was showing in 2 pages.
When I removed 11th record from second page, It is not pointing to first oage whihc has values.
It is showing 2nd page and saying that , there are no records to display.
Could you please help me to resolve this issue.
I really appreciate , if some one helps me regarding this.
Thanks
Usha
3 Answers, 1 is accepted
0
Hello Prathyusha,
I tried to replicate the issue which you described, but to no avail as you can see in this demo.
Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.
Best wishes,
Mira
the Telerik team
I tried to replicate the issue which you described, but to no avail as you can see in this demo.
Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.
Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

prathyusha
Top achievements
Rank 1
answered on 16 Dec 2011, 04:52 PM
thank u so much for the reply.
But still I am not able to resolve the issue.
Here is my gridcode
Could you please suggest me? Do i need any other property to the grid.
<div id="dvTemplate" runat="server">
<telerik:RadGrid ID="TemplateRadGrid" runat="server" AllowPaging="True" DataSourceID="TemplateDataSource"
GridLines="None" AllowCustomPaging="true" AllowSorting="true" PageSize="10" PagerStyle-FirstPageText="<%$ Resources:global, lbl_radgrid_page_size %>"
MasterTableView-EditFormSettings-EditColumn-HeaderText="<%$ Resources:global, lbl_radgrid_edit %>"
MasterTableView-EditFormSettings-EditColumn-HeaderTooltip="<%$ Resources:global, lbl_radgrid_edit %>"
AutoGenerateColumns="false" OnItemCreated="TemplateRadGrid_ItemCreated"
OnItemCommand="TemplateRadGrid_ItemCommand" OnItemDataBound="TemplateRadGrid_ItemdataBound"
Width="960px" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" >
<MasterTableView AllowMultiColumnSorting="false" DataKeyNames="Id,TemplateName,HasAllCostCenter"
CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New Template"
CommandItemSettings-ShowRefreshButton="false" ShowFooter="true">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="<%$ Resources:global, lbl_radgrid_edit %>"
UniqueName="EditCommandColumn" UpdateText="Update" EditText="Edit" CancelText="Cancel"
ItemStyle-CssClass="centerTDBorder" EditImageUrl="../Resources/images/icons/edit_doc_small.png">
<ItemStyle CssClass="centerTD leftBorder" Width="50px" />
</telerik:GridEditCommandColumn>
<telerik:GridTemplateColumn UniqueName="TemplateName_TemplateColumn" HeaderText="<%$ Resources:lbl_radgridTemplateName %>"
EditFormHeaderTextFormat="<%$ Resources:lbl_radgridTemplateName %>" DataField="TemplateName"
SortExpression="TemplateName">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "TemplateName")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txt_TemplateName" runat="server" AutoPostBack="true" Text='<%# DataBinder.Eval(Container.DataItem,"TemplateName" ) %>'
MaxLength="50" ToolTip="Maximum number of characters allowed is 50"></telerik:RadTextBox >
<div class="invalidMessage">
<asp:RequiredFieldValidator ID="rfv_TemplateName" runat="server" ControlToValidate="txt_TemplateName"
Display="Dynamic" ErrorMessage="Template name is required"></asp:RequiredFieldValidator>
</div>
<div class="invalidMessage">
<asp:RegularExpressionValidator ID="rgx_TemplateName" runat="server" ErrorMessage="Allowed characters(Alphanumeric,- ,_/ )"
Display="Dynamic" ControlToValidate="txt_TemplateName" ValidationExpression="^[a-zA-Z,0-9-,_/ ]+$">
</asp:RegularExpressionValidator>
<div style="color: Red;">
<asp:Label ID="lbl_UniqueTempName" runat="server" Text="Duplicate Template Name"
Visible="false"></asp:Label>
</div>
</div>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="TemplateDescription_TemplateColumn" HeaderText="<%$ Resources:lbl_radgridTemplateDescription %>"
EditFormHeaderTextFormat="<%$ Resources:lbl_radgridTemplateDescription %>" SortExpression="TemplateDescription">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "TemplateDescription")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txt_TemplateDescription" runat="server" AutoPostBack="true" Text='<%# DataBinder.Eval(Container.DataItem,"TemplateDescription" ) %>'
MaxLength="500" ToolTip="Maximum number of characters allowed is 500"></telerik:RadTextBox>
<div class="invalidMessage">
<asp:RequiredFieldValidator ID="rfv_TemplateDescription" runat="server" ControlToValidate="txt_TemplateDescription"
Display="Dynamic" ErrorMessage="Template descriprion is required"></asp:RequiredFieldValidator>
</div>
<div class="invalidMessage">
<asp:RegularExpressionValidator ID="rgx_Templatedesc" runat="server" ErrorMessage="Allowed characters(Alphanumeric,- ,_/ )"
Display="Dynamic" ControlToValidate="txt_TemplateDescription" ValidationExpression="^[a-zA-Z,0-9-,_/ ]+$"></asp:RegularExpressionValidator>
<div style="color: Red;">
<asp:Label ID="lbl_UniqueTempdesc" runat="server" Text="Duplicate Template Description"
Visible="false"></asp:Label>
</div>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PrivHyperLinkColumn" ItemStyle-CssClass="centerTD"
HeaderText="Permissions">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PrivHyperLink" Text="Edit Permissions" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "EditPermissions"%>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PolHyperLinkColumn" ItemStyle-CssClass="centerTD"
HeaderText="Policies">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PolHyperLink" Text="Edit Policies" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "EditPolicies" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PrivHyperLinkROColumn" ItemStyle-CssClass="centerTD"
HeaderText="Permissions">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PrivROHyperLink" Text="View Permissions" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "ViewPermissions" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PolHyperLinkROColumn" ItemStyle-CssClass="centerTD"
HeaderText="Policies">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PolROHyperLink" Text="View Policies" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "ViewPolicies" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Additional Cost Centers" ItemStyle-CssClass="addCostCenter" UniqueName="AdditiCostCenter_TemplateColumn">
<ItemTemplate>
<asp:Label ID="lbl_additionalCC" runat="server" Text='<%# Convert.ToBoolean(Eval("HasAllCostCenter")) == true ? "All" : "Special List" %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<div id="dvAddiCostCenters" runat="server" class="radios">
<asp:RadioButton ID="rdoAll" runat="server" Text="All" GroupName="CCGroup" />
<asp:RadioButton ID="rdoSpecList" runat="server" Text="Special List" GroupName="CCGroup" Checked="true" />
</div>
</EditItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="CopyTemplateColumn" Visible="false" HeaderText="CopyFrom">
<EditItemTemplate>
<telerik:RadComboBox DataSourceID="TemplateDataSourceForCopy" DataTextField="TemplateName"
DataValueField="Id" ID="ddlTargetTemplate" Width="100" Visible="true" runat="server"
OnDataBound="TemplateDataSourceForCopy_DataBound">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="<%$ Resources:global, lbl_radgrid_delete %>"
UniqueName="DeleteColumn" HeaderText="<%$ Resources:global, lbl_radgrid_delete %>"
HeaderTooltip="<%$ Resources:global, lbl_radgrid_delete %>" ItemStyle-CssClass="centerTD"
ImageUrl="../Resources/images/icons/disapprove.png">
<ItemStyle HorizontalAlign="Center" CssClass="centerTD" />
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings ColumnNumber="3" FormMainTableStyle-CssClass="radFormTable" InsertCaption="Add new Template"
CaptionFormatString="Edit Template details" CaptionDataField="Id">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="editFormHeading"></FormCaptionStyle>
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<FormStyle></FormStyle>
<EditColumn UpdateText="Save Changes" UniqueName="EditCommandColumn1" ButtonType="PushButton"
ItemStyle-CssClass="buttonClass" CancelText="Cancel">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="TemplateDataSourceForCopy" runat="server" SelectMethod="GetAllTemplates" TypeName="EA.SpendManagement.UI.Views.BaseCache" ></asp:ObjectDataSource>
<asp:ObjectDataSource ID="TemplateDataSource" EnablePaging="True" TypeName="EA.SpendManagement.UI.Views.BaseCache"
SelectCountMethod="GetTemplateCount" SelectMethod="GetAllTemplates" StartRowIndexParameterName="startRowIndex"
MaximumRowsParameterName="maximumRows" runat="server">
</asp:ObjectDataSource>
<asp:HiddenField ID="hdn_Id" runat="server" />
</div>
Thanks
Prathyusha
But still I am not able to resolve the issue.
Here is my gridcode
Could you please suggest me? Do i need any other property to the grid.
<div id="dvTemplate" runat="server">
<telerik:RadGrid ID="TemplateRadGrid" runat="server" AllowPaging="True" DataSourceID="TemplateDataSource"
GridLines="None" AllowCustomPaging="true" AllowSorting="true" PageSize="10" PagerStyle-FirstPageText="<%$ Resources:global, lbl_radgrid_page_size %>"
MasterTableView-EditFormSettings-EditColumn-HeaderText="<%$ Resources:global, lbl_radgrid_edit %>"
MasterTableView-EditFormSettings-EditColumn-HeaderTooltip="<%$ Resources:global, lbl_radgrid_edit %>"
AutoGenerateColumns="false" OnItemCreated="TemplateRadGrid_ItemCreated"
OnItemCommand="TemplateRadGrid_ItemCommand" OnItemDataBound="TemplateRadGrid_ItemdataBound"
Width="960px" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" >
<MasterTableView AllowMultiColumnSorting="false" DataKeyNames="Id,TemplateName,HasAllCostCenter"
CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New Template"
CommandItemSettings-ShowRefreshButton="false" ShowFooter="true">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="<%$ Resources:global, lbl_radgrid_edit %>"
UniqueName="EditCommandColumn" UpdateText="Update" EditText="Edit" CancelText="Cancel"
ItemStyle-CssClass="centerTDBorder" EditImageUrl="../Resources/images/icons/edit_doc_small.png">
<ItemStyle CssClass="centerTD leftBorder" Width="50px" />
</telerik:GridEditCommandColumn>
<telerik:GridTemplateColumn UniqueName="TemplateName_TemplateColumn" HeaderText="<%$ Resources:lbl_radgridTemplateName %>"
EditFormHeaderTextFormat="<%$ Resources:lbl_radgridTemplateName %>" DataField="TemplateName"
SortExpression="TemplateName">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "TemplateName")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txt_TemplateName" runat="server" AutoPostBack="true" Text='<%# DataBinder.Eval(Container.DataItem,"TemplateName" ) %>'
MaxLength="50" ToolTip="Maximum number of characters allowed is 50"></telerik:RadTextBox >
<div class="invalidMessage">
<asp:RequiredFieldValidator ID="rfv_TemplateName" runat="server" ControlToValidate="txt_TemplateName"
Display="Dynamic" ErrorMessage="Template name is required"></asp:RequiredFieldValidator>
</div>
<div class="invalidMessage">
<asp:RegularExpressionValidator ID="rgx_TemplateName" runat="server" ErrorMessage="Allowed characters(Alphanumeric,- ,_/ )"
Display="Dynamic" ControlToValidate="txt_TemplateName" ValidationExpression="^[a-zA-Z,0-9-,_/ ]+$">
</asp:RegularExpressionValidator>
<div style="color: Red;">
<asp:Label ID="lbl_UniqueTempName" runat="server" Text="Duplicate Template Name"
Visible="false"></asp:Label>
</div>
</div>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="TemplateDescription_TemplateColumn" HeaderText="<%$ Resources:lbl_radgridTemplateDescription %>"
EditFormHeaderTextFormat="<%$ Resources:lbl_radgridTemplateDescription %>" SortExpression="TemplateDescription">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "TemplateDescription")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txt_TemplateDescription" runat="server" AutoPostBack="true" Text='<%# DataBinder.Eval(Container.DataItem,"TemplateDescription" ) %>'
MaxLength="500" ToolTip="Maximum number of characters allowed is 500"></telerik:RadTextBox>
<div class="invalidMessage">
<asp:RequiredFieldValidator ID="rfv_TemplateDescription" runat="server" ControlToValidate="txt_TemplateDescription"
Display="Dynamic" ErrorMessage="Template descriprion is required"></asp:RequiredFieldValidator>
</div>
<div class="invalidMessage">
<asp:RegularExpressionValidator ID="rgx_Templatedesc" runat="server" ErrorMessage="Allowed characters(Alphanumeric,- ,_/ )"
Display="Dynamic" ControlToValidate="txt_TemplateDescription" ValidationExpression="^[a-zA-Z,0-9-,_/ ]+$"></asp:RegularExpressionValidator>
<div style="color: Red;">
<asp:Label ID="lbl_UniqueTempdesc" runat="server" Text="Duplicate Template Description"
Visible="false"></asp:Label>
</div>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PrivHyperLinkColumn" ItemStyle-CssClass="centerTD"
HeaderText="Permissions">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PrivHyperLink" Text="Edit Permissions" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "EditPermissions"%>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PolHyperLinkColumn" ItemStyle-CssClass="centerTD"
HeaderText="Policies">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PolHyperLink" Text="Edit Policies" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "EditPolicies" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PrivHyperLinkROColumn" ItemStyle-CssClass="centerTD"
HeaderText="Permissions">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PrivROHyperLink" Text="View Permissions" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "ViewPermissions" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn ReadOnly="true" UniqueName="PolHyperLinkROColumn" ItemStyle-CssClass="centerTD"
HeaderText="Policies">
<ItemTemplate>
<asp:LinkButton runat="server" ID="PolROHyperLink" Text="View Policies" CommandName='<%# Eval("Id") %>'
CommandArgument='<%# Eval("TemplateName")+";"+ "ViewPolicies" %>' OnClick="NavigateToTemplateScreen"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Additional Cost Centers" ItemStyle-CssClass="addCostCenter" UniqueName="AdditiCostCenter_TemplateColumn">
<ItemTemplate>
<asp:Label ID="lbl_additionalCC" runat="server" Text='<%# Convert.ToBoolean(Eval("HasAllCostCenter")) == true ? "All" : "Special List" %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<div id="dvAddiCostCenters" runat="server" class="radios">
<asp:RadioButton ID="rdoAll" runat="server" Text="All" GroupName="CCGroup" />
<asp:RadioButton ID="rdoSpecList" runat="server" Text="Special List" GroupName="CCGroup" Checked="true" />
</div>
</EditItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="CopyTemplateColumn" Visible="false" HeaderText="CopyFrom">
<EditItemTemplate>
<telerik:RadComboBox DataSourceID="TemplateDataSourceForCopy" DataTextField="TemplateName"
DataValueField="Id" ID="ddlTargetTemplate" Width="100" Visible="true" runat="server"
OnDataBound="TemplateDataSourceForCopy_DataBound">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="<%$ Resources:global, lbl_radgrid_delete %>"
UniqueName="DeleteColumn" HeaderText="<%$ Resources:global, lbl_radgrid_delete %>"
HeaderTooltip="<%$ Resources:global, lbl_radgrid_delete %>" ItemStyle-CssClass="centerTD"
ImageUrl="../Resources/images/icons/disapprove.png">
<ItemStyle HorizontalAlign="Center" CssClass="centerTD" />
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings ColumnNumber="3" FormMainTableStyle-CssClass="radFormTable" InsertCaption="Add new Template"
CaptionFormatString="Edit Template details" CaptionDataField="Id">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="editFormHeading"></FormCaptionStyle>
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<FormStyle></FormStyle>
<EditColumn UpdateText="Save Changes" UniqueName="EditCommandColumn1" ButtonType="PushButton"
ItemStyle-CssClass="buttonClass" CancelText="Cancel">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="TemplateDataSourceForCopy" runat="server" SelectMethod="GetAllTemplates" TypeName="EA.SpendManagement.UI.Views.BaseCache" ></asp:ObjectDataSource>
<asp:ObjectDataSource ID="TemplateDataSource" EnablePaging="True" TypeName="EA.SpendManagement.UI.Views.BaseCache"
SelectCountMethod="GetTemplateCount" SelectMethod="GetAllTemplates" StartRowIndexParameterName="startRowIndex"
MaximumRowsParameterName="maximumRows" runat="server">
</asp:ObjectDataSource>
<asp:HiddenField ID="hdn_Id" runat="server" />
</div>
Thanks
Prathyusha
0
Hello Prathyusha,
I have examined your code and noticed that you use custom paging with object data source.
Please make sure that you follow these resources:
Custom Paging
Custom Paging through ObjectDataSource Population
I hope this helps.
All the best,
Mira
the Telerik team
I have examined your code and noticed that you use custom paging with object data source.
Please make sure that you follow these resources:
Custom Paging
Custom Paging through ObjectDataSource Population
I hope this helps.
All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now