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
90
How to make paging and sorting work if I pass only current page in the datasource
posted

Hello,

because our queries are returning gigabytes of data we want to return from the database only the data that the current page will display.

This has as a result the paging and the sorting not working as expected anymore. 

Could you please indicate how I could make the xamGrid requery when sorting and also how to tell it how many pages the data is. currently it says 1.

Thank you

  • 34810
    Offline posted

    Hello Anastasios,

    I have been investigating into the behavior you are looking to achieve in this case, and it sounds like you are only passing a page-worth of data to the XamGrid.ItemsSource in this case, in which case it is expected that the XamGrid only returns that it has a single page in the pager. In order to have more pages shown in the pager, you need to bind the grid to enough items to show multiple pages in the pager. There does not exist a way to define a set number of pages - it will be based on the number of entries in your underlying data source.

    If you are unable to bring all of your data in and are looking to have more pages working as a pager in the XamGrid, I would then have to recommend building an external one, as you will then be able to query your underlying data source or database to push the current page into the grid. Similarly, you can also handle the ColumnSorted event to query your underlying data source / database to populate the ItemsSource of the XamGrid correctly.

    Please let me know if you have any other questions or concerns on this matter.