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 : Nov 16th 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:

Created:

Updated:

Platform:

Replies:

105598 Oct 18,2012 05:43 PM UTC Nov 28,2012 08:51 AM UTC WPF 1
loading
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:GridDataControl.ConditionalFormats>

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

                    <syncfusion:GridDataConditionalFormat.Style>

                        <syncfusion:GridDataStyleInfo Foreground="Red" />

                    </syncfusion:GridDataConditionalFormat.Style>

                    <syncfusion:GridDataConditionalFormat.Conditions>

                        <syncfusion:GridDataCondition ColumnName="Date"

                                                      ConditionType="Equals"

                                                      PredicateType="Or"

                                                      Value="{Binding Today}" />

                        <syncfusion:GridDataCondition ColumnName="Date"

                                                      ConditionType="GreaterThan"

                                                      PredicateType="Or"

                                                      Value="{Binding Today}" />

                    </syncfusion:GridDataConditionalFormat.Conditions>

                </syncfusion:GridDataConditionalFormat>

            </syncfusion:GridDataControl.ConditionalFormats>

 

 

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

http://www.syncfusion.com/downloads/Support/DirectTrac/101303/GDC_DateDescription1263098285.zip

 

Regards,

Ravi Shankar B.


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

;