Dear Sir or Madam,
I use DevExpress WPF GridControl to display table of data in my application. It uses CheckBoxSelectorColumn to provide best muliselection user experience.
My DevExpress version is 15.1.
I bound ItemsSorce property to my property named CarCollection, which is ObservableCollection.
To refresh all data on UI I set new ObservableCollection instance (contains new data) to CarCollecition. Next, GridContol get new data and displays it, but it does not reset SelectedItems property.
Finally, I have refreshed UI that I expect and all checkboxes are unchecked so SelectedItems should be empty.
Right now I applied workaround. First, I’m clearing the CarCollection to ensure that GridControl clear SelectedItems property. Next, I’m setting new ObservableCollection instance to CarCollection containing new data.
Is it an issue or bug? I think that is should work automatically instead I have to clear list manually every time if I want to replace it by other.
Best Regards,
Maciej Klemarczyk
Hello Maciej,
It's not clear to me how exactly you refresh your ObservableCollection. Are you clearing it and populating it with new items? I've tried this approach and all previously selected items are cleared in the GridControl (see the attached screencast).
Perhaps, I missed something important. Would you please modify the attached sample, so we can reproduce the issue on our side? This will help us find the cause of the issue and suggest a more suitable solution. We are looking forward to your response.
Thanks,
Andrey
Yes, It works how you show on screen-cast.
If you check the SelectedItems property after this action it will still contains previously selected items.
I've updated the sample, so the SelectedItems is used in the bottom ListBox. As you can see, it's content is also cleared after I click the Refresh button. Did I miss anything?
Andrey
I have a little differed approach.
Use this code behind file.
Thank you for the provided file. I've reproduced this behavior and forwarded this ticket to our R&D team for further research. We will update this thread as soon as we have any news.
Thanks,
Andrey