Is there any way to add a condition group in runtime?
I mean, without use "Conditional Formatting dialog box"
Thanks for the replies,
I'm very grateful...
Best regards
Just an FYI - the Conditional Appearances functionality is really designed to help you make things easier at design-time.
If you are going to apply appearances to your cells or rows at run-time, then it's much easier and a lot less code to simply use the InitializeRow event of the grid.
// Populate a ConditionGroup with two separate conditionsOperatorCondition condition1 = new OperatorCondition( ConditionOperator.StartsWith, "a", false );OperatorCondition condition2 = new OperatorCondition( ConditionOperator.StartsWith, "z", false );ConditionGroup group = new ConditionGroup();group.Add( condition1 );group.Add( condition2 );
// Create an Appearance for the conditionsInfragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();appearance.ForeColor = Color.Red;
// Create a ConditionValueAppearance using the ConditionGroup and Appearance// we created aboveConditionValueAppearance valueAppearance = new ConditionValueAppearance();valueAppearance.Add( group, appearance );
// Assign the ConditionValueAppearance to the column's ValueBasedAppearancethis.ultraGrid.DisplayLayout.Bands[0].Columns["whatever"].ValueBasedAppearance = valueAppearance;