By Tom Hundley on
7/8/2008 3:55 PM
The Telerik RadGrid automatically goes to the last page of the grid when inserting records, which is fine you don't care about seeing the newly inserted item. This code will show you how to select the page and row which was just created. The commented code at the bottom will also show you how to open the record in edit mode in cases where you need the page opened in such a manner.
Simply subscribe to the PreRender event of the grid, enumerate the datasource directly to get the new records row index so that you can determine the page index and there you go. Note that the Items collections on all of the grid objects only have the total number of items in that page, which is why you need to enumerate the datasource.
if (Session[sessionObjectToFind] != null)
{
Guid storeRefId = new Guid(Session[sessionObjectToFind].ToString());
Session[sessionObjectToFind] = null;
int pageIndex = 0;
int rowIndex = 0;
for...
Read More »