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
585
Pagination and mutliple observable collections
posted

Please bear with me for the setup.

I have 2 or more Observable collections that I bind to the XamDataGrid at runtime based on a user preference. These collections are also paginated (500 at a time) and loaded on demand. The loading occurs when the users scrolls within 25 records of the xamDataGrid.GetRecordsInView() last viewable record.

This all works perfectly if and only if I do not change the XamDataGrid.DataSource.

When I do change the datasource the XamDataGrid does change as well to the proper collection, column headers change, everthing looks great. As I scroll though and get to the 475th (500 - 25 record buffer) visible record the code fires to load the next 500. It loads in the observable collection, increases the count to 1,000. The grid however does not load the next 500 records. It's record count says at 500. I end up being stuck basically because the grid has 500 records loaded, but the collection has 1,000.

To be clear if I run my app and do not change the datasource on the fly, everything works fine. This only happens when I change collections at run time.

I hope I gave enough explanation here. If not ask away and I will answer.