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)
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.
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
thanks for the quick reply
is there a way i can copy or duplicate the rule instead of going to the ruleFactory method multiple times?