Move Next Previous Record with VirtualLoadMode enabled

8 replies. Last post: December 4, 2009 4:02 AM by Madhavan G
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Madhavan GMember

Hi ALL,

We are working on the requirement of moving next and previous record on click of button.

But We have enabled VirtualLoadMode.

Say we have virtualpagesize is 6 and totally there are 30 records.

Say when the grid loads it will load with 6 of 30.

Say I am in 6th Record and I want to go 7th record on click of MoveNext button.

How we can achieve this?

We are using the following code for MoveNext and MovePrevious.

 

Please advice,

 

MoveNext:

var grid = ISGetObject("WebGrid1"); var selectedObject = grid.GetSelectedObject(); if (selectedObject != null)

{

var selectedRow = selectedObject.ToRowObject();

var nextRow = selectedRow.GetNextRow();

if(nextRow !=null)

nextRow.Select();

}

 

MovePrevious:

var grid = ISGetObject("WebGrid1"); var selectedObject = grid.GetSelectedObject(); if (selectedObject != null)

{

var selectedRow = selectedObject.ToRowObject(); // return WebGridRow object var previousRow = selectedRow.GetPreviousRow(); // get previous row object if(previousRow !=null)

previousRow.Select();

}

Regards,

Madhavan

All times are GMT -5. The time now is 3:27 AM.
Previous Next