Custom Paging from Code Behind only (no ISDataSource being set in aspx file)

1 reply. Last post: July 21, 2011 4:08 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
davidpendryMember
)

Hi,

I have a webgrid which is bound from a cutom object. The Grid is bound to a single object of type

public class BindMyData : CollectionBase, IHierarchicalList

{...}


All works fine on paging if the PagingMode="ClassicPaging" is implemented & load on demand i NOT set.

The problem aries is when the attribute PagingLoadMode="Custom" is set. (I need to set this flag due to the very slow load time on initial requests to get ALL the object collection, therebye allowing the collection to be loaded by page each time)

Can you please provide a complete code behind solution for this ?

From the documentation it look as if
the WebGrid framework expects a ISDataSource to implement a SelectCountMethod="GetCount"
and SelectMethod="GetData" in which the following is required.

-> public DataTable GetData(int startRowIndex, int maximumRows, string sortExpression)

How do i get paging forward and backward to initiate a postback so i can handle the event myself ?
How do i get the targetted page number ?

Thanks


Pendry

All times are GMT -5. The time now is 12:25 AM.
Previous Next