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

Update custom row style selector when changed a property

Thread ID:





129183 Mar 2,2017 04:41 PM UTC Mar 7,2017 04:29 AM UTC UWP 3
Tags: SfDataGrid
Alexandru Pastor Opris
Asked On March 2, 2017 04:41 PM UTC


I have a custom RowStyleSelector applied to SfDataGrid, its functionality is to change background color of certain rows based on some cell values (age value). It works well with initial values or when add new item it refresh style of all rows correctly.

However when user changes those value doesn't automatically change row color. How can I trigger the row style selector update automatic when changed a property?

Thanks, have a nice day.

Attachment: SfDatagridRowStyle_1997e854.rar

Balamurugan Rajaraman [Syncfusion]
Replied On March 6, 2017 07:38 AM UTC

Hi Alexandru, 
Thank you for contact syncfusion support. 
We have analyzed you query “update custom row style when changed a property”. You can able to achieve your requirement by Calling the UpdateDataRow() method as like below.  
Code Sample: 
private void DataGridField_Loaded(object sender, RoutedEventArgs e) 
    this.DataGridField.View.RecordPropertyChanged += View_RecordPropertyChanged; 
private void View_RecordPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 
    //Here update the data row to change the style. 
    var rowindex = this.DataGridField.ResolveToRowIndex(sender); 
We have modified the provided sample to achieve your requirement. You can download the sample from the below link 
Please let us know if you have any query. 
Balamurugan R 

Alexandru Pastor Opris
Replied On March 6, 2017 08:51 AM UTC

Hello Balamurugan,

Thank you a lot for the answer and the updated sample, thats exactly what we wanted, works like a charm.

Thanks again and have a nice day.

Balamurugan Rajaraman [Syncfusion]
Replied On March 7, 2017 04:29 AM UTC

Hi Alexandru, 
Thanks for the update. 
Please let us know if you have any 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