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

changing the foreground on entire grid entry by value

Thread ID:





105598 Oct 18,2012 05:43 PM UTC Nov 28,2012 08:51 AM UTC WPF 1
Tags: GridControl
Matthew Eiden
Asked On October 18, 2012 05:43 PM UTC

I am trying to change the cell color based on a single value not based on that cell.  I have a list of calendar events some are active and some are not, if the event is inactive I want the cell to show the event description in red, otherwise in black.  This needs to be either in the xaml or using a MVVM, code behind is not an option.  I have looked and I only see ways to change it based on the cell itself not another cell.


Ravi Shankar B [Syncfusion]
Replied On November 28, 2012 08:51 AM UTC

Hi Matthew,


We have analyzed your query and you can achieve it throw XAML level in sample. For your requirement you can set conditional formatting as code suggested follows.


XAML code snippet:


                <syncfusion:GridDataConditionalFormat Name="Condition" ApplyStyleToColumn="Description">


                        <syncfusion:GridDataStyleInfo Foreground="Red" />



                        <syncfusion:GridDataCondition ColumnName="Date"



                                                      Value="{Binding Today}" />

                        <syncfusion:GridDataCondition ColumnName="Date"



                                                      Value="{Binding Today}" />






We have created a simple sample for this and you can download it from the following link.




Ravi Shankar B.


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