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 }
Oh, I see. No, I don't think there is any way to do that with conditional formatting.Except for the obvious way, which would be to change the value of the condition to a higher value. You could change it to 10.15, for example - assuming you know the formatting.
Another option might be to use the InitializeRow event instead of Conditional Formatting. Conditional Formatting is really designed to be used at run-time, anyway. It's actually more code to set it up at design-time than to use InitializeRow. In InitializeRow you could examine the Text property of the cell and use double.Parse to get a value from the text and use that as the basis of your condition instead of the actual cell Value.
Hi Mike,
I guess i wasn't clear in my post.
the condition is lessThan or Equal to 10.1
the fourth cell's value is 10.108. but it's appearing as 10.1 due to the format applied.
so what i am facing is that the fourth cell is not highlighted. i just want to know if there is a way of doing that based on the text of the cell not the Value.
thx
Hi Hady,
I tried your sample. Initially, the sample only has a condition for LessThan or Equal to 10.1.It appears to work fine, the first 3 cells are highlighted.
When I comment out that condition and put in the one for GreaterThan, it again works fine for me. All except the first three rows are highlighted in yellow.
Hi,
please find attached a sample. i have a grid containing numbers. i added a conditional formatting on the numbers greater than or equal 10.1. the cell showing 10.1 (which value is 10.108) wasnt affected. is there a way of doing this?
Can you post a sample project demonstrating the issue? As I had mentioned, I tried out the exact code that you had posted, with the only difference being that I had to create my own data source, with a Decimal column created that didn't happen to have the same name as your column. It may be possible that an issue was fixed in the latest service release, but I can't really say since I'm not sure what is preventing this from working for you.
-Matt