We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind the SelectedItems property of SfDataGrid to ViewModel property?

SfDataGrid.SelectedItems is a collection property. So, whenever the SelectedItems collection is changed, the property bound with SelectedItems does not get notified for this change. However, you can achieve this by creating an attached property for SelectedItems.

The following is an attached property created for SfDataGrid and the property value is updated based on SfDataGrid.SelectedItems.CollectionChanged event.


SfDataGrid’s SelectedItems values are set to the attached property by using SelectedItems.Collectionchanged event.

The following is the ViewModel property bound to the attached property that you created in the above code example.


Now, whenever the SelectedItems collection is changed the ViewModel property gets notified via the attached property.

Sample Links:




Article ID: Published Date: Last Revised Date: Platform: Control: Product Version:
3071 01/02/2015 02/16/2016 WinRT SfDataGrid
Did you find this information helpful?
David Clark May 21, 2015
I am having trouble figuring out how to use this code. How do I access SelectedItemsBehaviour.SelectedItems in my Xaml?
ingo asch Dec 06, 2017


Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon