Intersoft WebGrid Documentation
How-to: Implement custom Virtual Load
See Also Send comments on this topic.

Glossary Item Box

Custom VirtualLoad is one of VirtualLoad features which allow developer to setup a grid with their own implementation and logic for fetching the data. Note that sorting, editing and all other data-aware functionalities can work in this mode, except Grouping since that Grouping requires all rows to be loaded.

In this topic, you will learn how to implement the custom virtual load in WebGrid.

To Implement custom Virtual Load in WebGrid

  1. Set the PagingMode to VirtualLoad.
  2. Set the VirtualLoadMode to Custom.
  3. Drag ISDataSource control from toolbox to the designer surface.
  4. Configure Data Source for the newly created ISDataSource.
  5. Select DataSet for the SchemaType.
  6. Click Schema Name dropdown and select dsNorthWind from the list.
  7. In the next dialog, click AutoGenerate button which is located at the most bottom. Click Finish.
  8. Drag WebGrid control from toolbox to the designer surface.
  9. Set the DataSourceID to ISDataSource1.
  10. In the Connect to DataSource dialog, select Orders table as root table and select Retrieve  Structure, then click OK.
  11. Right click on ISDataSource1 and launch the designer, set the Orders table's SelectCount property to GetCount.
  12. For the WebGrid, set the PagingMode to VirtualLoad and VirtualLoadMode to Custom.
  13. Write codes that handle virtual load and the total row count in App_Code. For reference, see the codes in App_Code\dsNorthwind_Extended.cs.
  14. Run the page in browser.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.