StyleFormatConditionCollection Class
A style condition collection.
Namespace: DevExpress.XtraTreeList.StyleFormatConditions
Assembly: DevExpress.XtraTreeList.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList
Declaration
[ListBindable(false)]
public class StyleFormatConditionCollection :
FormatConditionCollectionBase
Related API Members
The following members return StyleFormatConditionCollection objects:
Remarks
The StyleFormatConditionCollection class supports legacy style format conditions. Instead of this feature, we suggest that you use the advanced conditional format rules to highlight cells matching your criteria. These format rules can be created with the TreeList.FormatRules property.
Example
The following example applies conditional formatting to the Tree List nodes. The nodes that have a value in the ‘Budget’ column greater than $100,000 but but less than $400,000, are painted using custom appearance settings. To do this, a new style format condition is created, customized and added to the Tree List’s TreeList.FormatConditions collection.
The image below shows the result.
using DevExpress.XtraTreeList.StyleFormatConditions;
// ...
// Create a new StyleFormatCondition object.
StyleFormatCondition condition = new StyleFormatCondition(
DevExpress.XtraGrid.FormatConditionEnum.Between, treeList1.Columns["Budget"],
null, 100000, 400000, true);
// Customize the appearance settings used to paint the nodes
// with cells in the 'Budget' column that have a value greater than 100000
// but less than 400000.
condition.Appearance.BackColor = Color.Orange;
condition.Appearance.BackColor2 = Color.Yellow;
condition.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
// Adds the format condition to the Tree List's FormatConditions collection.
treeList1.FormatConditions.Add(condition);