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.
The zip attached seems to be corrupt. Can you post it again?
Hello,
I suggest you to implement INotifyPropertyChanged interface in your ViewModel classes in order to inform the XamDataGrid when an object is added to the collection. Also you can try using BindingList<> instead of ObservableCollection<> .Let me know if this fixed the issue.
Regards
Vlad
So to see what is going I made a test app to try and reproduce this issue without any other possible interference. I have successfully reproduce this and I have it attached the project in zip file.
2 observable collections. Created and assigned to the grid based on a radio button click. The first one the user picks will scroll and load on demand no problem. It is the second one that the issue pops up. Once the user selects the second list the scroll event fires but the grid does not pick up the next 100 records.
I am really looking for some feedback on this, Anything could help.