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. Image for the cookie policy date

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

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

1 Reply

JN Jayaleshwari N Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon