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

Applying conditional formatting based on value of other cells

Thread ID:

Created:

Updated:

Platform:

Replies:

115880 Feb 17,2014 03:40 PM UTC Feb 27,2014 11:46 AM UTC WPF 1
loading
Tags: GridDataControl
Luca Cavicchioli
Asked On February 17, 2014 03:40 PM UTC

Hello, sorry if the question may be trivial, but I'm new of WPF and Syncfusion controls.
I've to apply a format to a cell if the value of another cell of the same row satisfies the condition specified.
Example:

var columnFormatting = new GridDataConditionalFormat { [...] };
var columnStyleInfo = new GridDataStyleInfo { [...] };
var conditionFormatting = new GridDataCondition
{
ColumnName = myColumnName,
ConditionType = GridDataConditionType.NotEquals,
Value = [***** Value contained in the cell of the same row and column named "myColumnName2" *****],
PredicateType = PredicateType.Or
};

columnFormatting.Style = columnStyleInfo;
columnFormatting.Conditions.Add(conditionFormatting);
myDataGrid.ConditionalFormats.Add(columnFormatting);

How is it possible to do that?
Thank you for your support. Regards
    Luca Cavicchioli

Saravanan M [Syncfusion]
Replied On February 27, 2014 11:46 AM UTC

Hi Luca,

We are sorry for delay caused,

 We have analyzed your query. We could not add Conditional Format based on next cell value. We can add the conditional format based on the same column value. But we are able to format the cell based on next cell value by using QueryCellInfo event. We have prepared the sample based on this and you can download the sample from attachment.

 Please let us know if you have any queries,

Regards,

Saravanan.M


Attachment: GDC_Sample_FormatCells_bc6b109e.zip

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

;