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.
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.
The zip attached seems to be corrupt. Can you post it again?
Ok i got winzip 12.1 and I used legacy zip to make this file.
I am really looking forward to your comments on this.
Hello,
I tried your sample and changed ObservableCollection to BindingList and it works correctly.
Alex.
Thank you for quick responses and service link for issue.
Hello again,
Andrew Smith has come up with another way around this issue by wrapping your datasource with a ListCollectionView like this:
xamDataGrid1.DataSource = new ListCollectionView(twos.AllTwos);
Nevermind that, we believe that there is an issue, because it should be working with ObservableCollection as well. I have created a support case on your behalf and going to link your case to this issue. You will be automatically notified when it is fixed and the Service Release is out.
Regards,
Confirmed.
Switching to BindingList over a ObservableCollection corrected my issue.