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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change GridCell style at runtime in SfDataGrid on WPF

Thread ID:

Created:

Updated:

Platform:

Replies:

121696 Jan 17,2016 03:37 PM Jan 25,2016 02:21 AM WPF 3
loading
Tags: SfDataGrid
Carlos Fernando Consigli
Asked On January 17, 2016 03:37 PM

Hello.
I'm trying to change the cell style according to its contents in a SfDataGrid.
I'm using style converters, following the StylePerformanceofSfDataGrid_WPF  sample (http://www.syncfusion.com/downloads/support/directtrac/132219/ze/StylePerformanceofSfDataGrid_WPF-24357210) posted in the article
https://www.syncfusion.com/kb/3176/how-to-improve-performance-when-using-formatting-and-styling-for-the-cells-based-on-data

The problem I'm having is that the style does not change immediately after editing. You need to scroll up and down or resize the window to force the re-render and see the new color of the cell (you can see that in the syncfusion sample).
In https://www.syncfusion.com/kb/4186/how-to-change-the-gridcell-style-at-runtime it is explained that you need to use UpdateDataRow but that method seems not to be in WPF, but only on WinRT.

Is UpdateDataRow an extension method and I'm missing an 'using' sentence? If it is actually only in WinRT, is it any other way to trigger the style selector and refresh the cell style immediately after ending editing the cell?
Thanks in advance

Fernando

Sowndaiyan Paulpandi [Syncfusion]
Replied On January 18, 2016 07:40 AM

Hi Fernando,

Thanks for contacting Syncfusion Support.

In SfDataGrid, the UpdateDataRow is an extension method. So we need to add the below namespace for invoke this method,

Code Example [C#]


using
Syncfusion.UI.Xaml.Grid.Helpers;


We have prepared a sample as per your requirement and you can download the same from the below location,

Sample: http://www.syncfusion.com/downloads/support/forum/121696/ze/StyleDataGrid_WPF1731056699


Regards,

Sowndaiyan


Carlos Fernando Consigli
Replied On January 23, 2016 04:20 PM

Hi Sowndaiyan.

Excellent, it worked perfectly and your samples are always helpful.
Thanks!

Fernando

Ashwini Paranthaman [Syncfusion]
Replied On January 25, 2016 02:21 AM

Hi Fernando,
Thank you for the update.
We are glad that your issue has been fixed.
Please let us know if you need any other assistance.
Regards,
Ashwini P.

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.

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

;