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

Custom row style selector refresh rows based on values.

Thread ID:





120502 Sep 21,2015 08:33 PM UTC Mar 21,2016 11:13 AM UTC WinRT 5
Tags: SfDataGrid
Asked On September 21, 2015 08:33 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. It works well with initial values. However when user changes those value doesn't automatically change row color. How can I trigger the row style selector update in those scenarios?


Jai Ganesh S [Syncfusion]
Replied On September 22, 2015 11:27 AM UTC

Hi Vasanth,

Thank you for using Syncfusion Products.

We have analyzed your query. When changing the value at runtime the StyleSelector is not called and the style is not applied based on the changed value. However you can achieve this requirement by calling the UpdateDataRow method and also by calling the InvalidateMeasureInfo() for visual container in the CurrentCellEndEdit event.

Code Example [C#]:

void datagrid_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs args)


        var rowindex = args.RowColumnIndex.RowIndex;



We have also prepared a sample based on this and you can download the sample from the below location,

Sample: http://www.syncfusion.com/downloads/support/directtrac/143149/ze/SfGridDemo-1646472712

Please let us know if you need further assistance.

Thank you,

Jai Ganesh S

Replied On September 22, 2015 02:29 PM UTC

Perfect, thank you!!

Jai Ganesh S [Syncfusion]
Replied On September 23, 2015 04:21 AM UTC

Hi Vasanth,

Thank you for the update.

Please let us know if you need further assistance on this.

Thank you,

Jai Ganesh S

Replied On March 18, 2016 03:10 PM UTC


How to do the same with WPF ?

Thank you.

Jayapradha S [Syncfusion]
Replied On March 21, 2016 11:13 AM UTC

Hi Vasanth,

You can trigger the style selector when you changed the cell value by using UpdateDataRow method in WPF  like in WinRT.
Please find the sample for WPF platform from the following location,

Sample Link: http://www.syncfusion.com/downloads/support/forum/120502/ze/RowStyleSelector_WPF906788637

Please refer the below KB document to change the cell value at runtime,
KB Link: https://syncfusion.com/kb/5992/how-to-change-the-gridcell-style-at-runtime



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