booody
booody

Reputation: 79

Open PageIndex in RadGrid

I have a RadGrid with paging enabled.

I want to know how to open a particular page on Grid_PreRender Event as I want to select an item that is not on first page.

Currently it doesn't open the page that the item is on, it just stays on the first page.

Any help please?

Upvotes: 0

Views: 1551

Answers (1)

Brian Garson
Brian Garson

Reputation: 1160

It's fairly simple and you can do it in your code behind and call it from your page load, find the position of the row you wish to show in your data source, in my case i've just used resultIndex, and determine which page it's on.

const int pageSize = 5;
var page = (resultIndex / pageSize);  //eg row 50 means page = 10
myGrid.CurrentPageIndex = page;
myGrid.Rebind();

Upvotes: 1

Related Questions