Bug Report T315041
Visible to All Users

The SelectedItems collection is not erased when the ItemsSource is changed

created 9 years ago (modified 9 years ago)

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

Show previous comments (2)
Andrey Marten (DevExpress Support) 9 years ago

    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

    MK MK
    Maciej Klemarczyk 9 years ago

      I have a little differed approach.
      Use this code behind file.

      Andrey Marten (DevExpress Support) 9 years ago

        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

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.