Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
DataSource Paging with UltraWebGrid
posted

My code is set up to do paging at the DataSource level. Up until now I was using the Microsoft GridView. It supports normal DataSource paging. DataSource paging is very simple. The grid asks for a page of data from the DataSource and then the DataSource calls the relevant method with the number of records it wants. This works in GridView.

However, I can't figure out how to make UltraWebGrid use this functionality. If I load 6000 records using a DataSet, paging occurs automatically in the UltraWebGrid. But if I point the grid to a DataSource where paging is enabled, it only displays one page and doesn't show any page numbers.

I looked in the knowledge base on how to achieve paging but it gave a very long example and talks about how to do the work yourself. I don't want to do this. The work is already being done by the DataSource.

How can I make the grid use DataSource paging?

Parents
  • 385
    posted

    More info on this. An article says:

    Standard paging simply requires that the application responds to the PageIndexChanged event to set the new page number and call DataBind(). UltraWebGrid indexes into the DataSource and finds the correct starting point and loads the grid with the PageSize number of rows.

    I am going for standard paging. EnableInternalRowsManagement is false. I am handling the PageIndexChanged event by setting the new page number and calling DataBind(). AllowPaging is true. AllowCustomPaging is false.

    I'm pretty sure that what is happening is that when the grid is rendered, it is not calling the GetCount method on the DataSource. Instead it is basing its record count on one page of data which of course will not work because one page is always going to display in one page.

    How can I force the grid to base its number of pages on the record count from the DataSource?

Reply Children