ConditionGroup conditionGroup = new ConditionGroup(); OperatorCondition operatorConditionA; OperatorCondition operatorConditionB; ConditionValueAppearance CondValue = new ConditionValueAppearance(); Appearance condAppearance; object objValue1 = 10.1, objValue2 = 19.7; //Customize appearance condAppearance = new Infragistics.Win.Appearance(); condAppearance.BackColor = Color.White; condAppearance.ForeColor = Color.Blue; operatorConditionA = new OperatorCondition(ConditionOperator.GreaterThan, objValue1); operatorConditionB = new OperatorCondition(ConditionOperator.LessThan, objValue2); conditionGroup.Add(operatorConditionA); conditionGroup.Add(operatorConditionB); conditionGroup.CombineOperator = LogicalOperator.And; CondValue.Add(conditionGroup, condAppearance); UltraGrid1.DisplayLayout.Bands[0].Columns["Grade"].ValueBasedAppearance = CondValue; Assume I have the following values in column "Grade": { 7, 8, 10, 10.1, 10.2, 10.3, 15, 18, 19.6, 19.7, 19.9 } I set column decimal format to 0, so visible values become: { 7, 8, 10, 10, 10, 15, 18, 19, 19, 19 } I do the following conditional formatting and I obtain the following values affected: { 15, 18 } What I want is compeltely different, I want the conditional formatting to work on cell original value { 10.2, 10.3, 15, 18, 19.6 } and show me the following cells affected: { 10, 10, 15, 18, 19 }
Ah, okay. Well, that's a reason to use ConditionalFormatting, then. :)
hi Mike,
I want also to save the conditional formatting applied by the user. currently this is done by saving the layout of the grid.
If i use the initialize row, i guess it wont be save when saving the grid's layout.
Mike Saltzman said:Conditional Formatting is really designed to be used at run-time, anyway.
Oops. I meant to say "Conditional Formatting is really designed to be used at design-time, anyway."
Hi Hady,
Hady said:I am using the conditional formatting at run-time.
Yes, I understand that. But what I am saying is... using ConditionalFormatting is very convenient at design-time. But at run-time, it's more code that using InitializeRow and it also can't really do what you want here.
So why use it? You would be better off using InitializeRow. It would be less code and you would be able to do what you want to do.
I am using the conditional formatting at run-time.
i will try the first suggestion.. but i dont think it will work coz the values are not static.