Different VirtualPageSize in VirtualLoad can be retrieved in a specific condition. You can navigate to anywhere in grid paging.
To Implement different VirtualPageSize in WebGrid
- Set the PagingMode to VirtualLoad.
- Set the VirtualPageSize property to a value.
- In the JavaScript, use the following code:
JavaScript Copy Code var timeout = 1000; function go_to() { var rowIndex = document.getElementById("txtGoto").value; move(rowIndex); } function move(rowIndex) { var grid = ISGetObject("WebGrid1"); if (grid.TotalLoadedRows < rowIndex) { wgLoadMore('WebGrid1'); setTimeout(function() {move(rowIndex);},timeout) } else { grid.RootTable.GetRow(rowIndex-1).Select(); } }
- Run the project.