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

Selected Item deselects itself after data update when column sort is on

Thread ID:

Created:

Updated:

Platform:

Replies:

142601 Feb 12,2019 12:33 AM UTC Feb 12,2019 12:26 PM UTC WPF 1
loading
Tags: SfDataGrid
Helge Keck
Asked On February 12, 2019 12:33 AM UTC

when column filtering is on, selected item deselects itself, after datasource update.

Jayaleshwari N [Syncfusion]
Replied On February 12, 2019 12:26 PM UTC

Hi Helge, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked the reported query “Selected Item deselects itself after data update when column sort is on” from our side. We would like to let you know that the SelectedItem deselects automatically when you do the refresh actions like changing itemssource,  filtering is the behavior. 
 
You can resolve the issue by maintain the SelectedItem before the action that you going to do and then update to datagrid.  
 
public class SalesInfoViewModel : NotificationObject 
{ 
    private SalesByYear selectedItem; 
    public SalesByYear SelectedItem 
    { 
        get { return selectedItem; } 
        set 
        { 
            selectedItem = value; 
            this.RaisePropertyChanged("SelectedItem");   
        } 
    } 
} 
 
(this.DataContext as SalesInfoViewModel).SelectedItem = (sender as SfDataGrid).SelectedItem as SalesByYear; 
 
 
Please let us know if you would require further assistance. 
 
Regards, 
Jayaleshwari N. 


CONFIRMATION

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

;