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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Notification on SelectRows()

Thread ID:





127747 Dec 6,2016 02:57 PM UTC Dec 12,2016 04:58 AM UTC WPF 3
Tags: SfDataGrid
Asked On December 6, 2016 02:57 PM UTC


I was wondering if SfDataGrid.SelectionChanged whould also be called when programatically selecting rows with SelectRows(r1, r2)?

Actually it does not trigger the notification. IS this a bug or am I doing something wrong?


Jai Ganesh S [Syncfusion]
Replied On December 8, 2016 02:12 PM UTC

Hi Bernd, 
We regret to inform you that, the SelectionChanged event will not be fired while we select the rows programmatically. This is the default behavior of SfDataGrid. However, you can get the notification while calling the SelectRows by using SelectedItems.CollectionChanged event like below, 
 this.datagrid.SelectedItems.CollectionChanged += SelectedItems_CollectionChanged; 
 private void SelectedItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 
            var selectedItem = e.NewItems[0]; 
Jai Ganesh S 

Replied On December 9, 2016 10:54 AM UTC

Hi Jai,

thank you for pointing out a direction. I have to see how I can make use of this because I do modifiy SelectedItems within my handler and this could lead to an infinite recursion so I could either disable/reenable the nofitication while processing it or I have to rewrite my code.

The reason I am modifing SelectedItems is because I want to support selection of groups (both collapsed and expanded) with automatically including all contained subgroups or items.

However, you can consider this issue as resolved.


Gobikrishnan Murugesan [Syncfusion]
Replied On December 12, 2016 04:58 AM UTC

Hi Bernd,  
Thank you for the update.  
Please let us know if you need further assistance on this.  


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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