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
XamDataGrid SelectedItems binding slowing down SelectAll Records


I have added a SelectedItems behaviour to my XamDataGrid in order to bind the SelectedItems to my view model. However I am now trying to select all the records using Ctrl+End/Ctrl+A. The binding slows the selection using these methods (guessing the SelectedItems event is firing once per items in the list), removing the binding resolves the issue. Is there a way to only fire the SelectedItems event this once when all the items have been selected?



  • 28970
    Offline posted

    Hello Michael,

    I have been investigating into this issue that you are reporting, and before I can really make a definite recommendation in this case, I'd like to know what exactly this SelectedItems behavior is that you are using in the XamDataGrid. Would it be possible for you to please provide some additional information or an isolated sample project that demonstrates this behavior in action?

    As for a way to get the SelectedItems collection to only fire once, something that I imagine you might be able to instead is bind the SelectedDataItems property of the XamDataGrid to an object[] property on your ViewModel. In doing this, you could handle the PreviewKeyDown event and look for the Ctrl+End or Ctrl+A key combination and put together an object[] containing all of your underlying data items, and then assign it to this property and mark the event handled. This is all speculated, and may not be an option on your end, though, and I would like to get more information about this behavior you are implementing.

    Please let me know if you have any other questions or concerns on this matter.

Reply Children
No Data