StyleFormatConditionCollection Class
A style condition collection.
Namespace: DevExpress.XtraTreeList.StyleFormatConditions
Assembly: DevExpress.XtraTreeList.v18.1.dll
Declaration
[ListBindable(false)]
public class StyleFormatConditionCollection :
FormatConditionCollectionBase
Related API Members
The following members accept/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);
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the StyleFormatConditionCollection class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.