This is a migrated thread and some comments may be shown as answers.

page index not persists in postback in radgrid.

2 Answers 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tirumalesh
Top achievements
Rank 1
Tirumalesh asked on 17 Nov 2011, 04:58 PM
when i did modifications(suppose in page index=3) and redirects the page to bind the modified values to grid,then my grid showing the values in pageindex=1 but not the values in 3rd page.

<telerik:RadGrid ID="RadGrid1" AllowPaging="True" EnableLinqExpressions="False" Skin="Default"
                    AllowSorting="True" AutoGenerateColumns="False" Width="470px" OnItemCreated="RadGrid1_ItemCreated"
                    OnNeedDataSource="RadGrid1_NeedDataSource" PageSize="15" ShowStatusBar="True"
                    GridLines="None" runat="server" CellSpacing="0" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPreRender="">
//data
</Radgrid>

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Nov 2011, 05:26 AM
Hello Tirumalesh,

RadGrid loses its current selection when the data is sorted, a new group or filter is added, or when the current page changes. Check the following help documentation which explains more about this.
Persisting the Selected Rows Server-side on Sorting/Paging/Filtering/Grouping

-Shinu.
0
Tirumalesh
Top achievements
Rank 1
answered on 18 Nov 2011, 05:42 AM
Hello Shinu,

i found the solution,we need to keep the new index in session, and do this in page load:

  this.RadGrid1.CurrentPageIndex = Convert.ToInt32(Session["RadGridCurrentPageIndex"]);
this.RadGrid1.MasterTableView.Rebind(); Shinu,you given to keep the row selection but i need to persist the page index Regards, Tirumalesh.
Tags
Grid
Asked by
Tirumalesh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Tirumalesh
Top achievements
Rank 1
Share this question
or