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.

How to refresh the row to apply conditional format style on Property change?

The GridDataControl has built-in support for conditional formatting. This feature allows you to format cells and rows based on a certain condition. This can be achieved by setting GridDataControl.ConditionalFormats property. ConditionalFormats is a collection property where you can add any number of conditions using GridDataConditionalFormat.

GridDataConditionalFormat has two properties, namely: Style, that is GridDataStyleInfo and Conditions, that is FreezableCollection of GridDataCondition. When the specified conditions are fulfilled, the given style is applied to the cell or row based on AppylStyleToColumn. If ApplyStyleToColumn is True, the style is applied to that particular cell that matches the conditions. Otherwise, the style is applied to the row.

Here, GridDataConditionlFormat is defined for “Total” column and ApplyStyleToColumn is False. So the specified style is applied to the row.

 

XAML

When data updates come from underlying data, the specific cells alone get refreshed in UI, for better performance reasons. So when you specify GridDataConditionalFormat for a row, the specific cells alone get refreshed, based on the style specified in GridDataConditionalFormat. You can refresh the row by setting GridDataControl.Model.RefreshWholeRow property to True, as shown in the following code snippet,

 

C#

In the following screenshot, the style is applied to the row based on Total column values as specified in the GridDataConditionalFormat. When the Total column value changes at runtime, the Row is refreshed, as you have set the GridDataControl.Model.RefreshWholeRow property to True.

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2544 08/28/2014 08/28/2014 WPF GridDataControl 4.5 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.