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

CurrentPageIndex in Grid

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 23 Jul 2011, 11:03 AM
If I move the pager, in NeedDataSource the CurrentPageIndex  is set to the current one, not to the desidered one.

To make correctly I need to manually set the CurrentPageIndex = e.NewPageIndex in the PageIndexChanged event and force a Rebind().

Is there an other way? Why I need to ask data twice to have data paged as I need (unfortunately the PageindexChanged is fired after NeedDataSource)?

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Jul 2011, 09:00 AM
Hello Andrea,

Try the following code snippet in PreRender event to get the current page index.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
   string strIndex = RadGrid1.MasterTableView.CurrentPageIndex.ToString();
}

Thanks,
Princy.
Tags
Grid
Asked by
Andrea
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or