Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5520
Conditional Formatting on multiple columns
posted

hi, 

i am applying conditional formatting on multiple columns using the following code:

if (cond.P_Condition == CONDITIONAL_FORMATTING.Between && cond.P_Value2 == null)

                return;

            if (cond.P_Value1 == null)

                return;

            ConditionalFormattingRuleBase cfrb = RuleFactory(cond);

            foreach (Column col in XamMainGrid.SelectionSettings.SelectedColumns)

                col.ConditionalFormatCollection.Add(cfrb);

 

the problem is that the formatting is applied only on the last selected column.

 

Parents
No Data
Reply
  • 6912
    Verified Answer
    posted

    Hi,

    A single rule can be applied on only one column. You have only one instance of the rule and it's associated with the last column.

    You can move the code creating the rule inside the loop, to create separate rule for each column.

    Regards

Children