# TreeList.FormatRules Property | WinForms Controls | DevExpress Documentation

# TreeList.FormatRules Property

Provides access to a collection of conditional formatting rules, which allow you to change the appearance of individual cells or rows based on specific conditions.

**Namespace**: [DevExpress.XtraTreeList](/WindowsForms/DevExpress.XtraTreeList)

        **Assembly**:
        DevExpress.XtraTreeList.v26.1.dll

## Declaration

- C#
- VB.NET

                        <section id="tabpanel_syntax_tabid_DevExpress.XtraTreeList.TreeList.FormatRules-csharp" role="tabpanel" data-tab="tabid-csharp" class="tab-group__tab-content tab-group__tab-content--code" style="display: block">
                            <pre><code data-code-links="{&quot;TreeListFormatRuleCollection&quot;:&quot;/WindowsForms/DevExpress.XtraTreeList.StyleFormatConditions.TreeListFormatRuleCollection&quot;}" class="lang-csharp hljs">[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true, 1002, XtraSerializationFlags.DefaultValue)]&#xA;[XtraSerializablePropertyId(5)]&#xA;public virtual TreeListFormatRuleCollection FormatRules { get; }</code></pre>
                        </section>
                        <section id="tabpanel_syntax_tabid_DevExpress.XtraTreeList.TreeList.FormatRules-vb" role="tabpanel" data-tab="tabid-vb" class="tab-group__tab-content tab-group__tab-content--code" style="display: none">
                            <pre><code data-code-links="{&quot;TreeListFormatRuleCollection&quot;:&quot;/WindowsForms/DevExpress.XtraTreeList.StyleFormatConditions.TreeListFormatRuleCollection&quot;}" class="lang-vb hljs">&lt;XtraSerializableProperty(XtraSerializationVisibility.Collection, True, False, True, 1002, XtraSerializationFlags.DefaultValue)&gt;&#xA;&lt;XtraSerializablePropertyId(5)&gt;&#xA;Public Overridable ReadOnly Property FormatRules As TreeListFormatRuleCollection</code></pre>
                        </section>

## Property Value

| Type | Description |
| --- | --- |
| [TreeListFormatRuleCollection](/WindowsForms/DevExpress.XtraTreeList.StyleFormatConditions.TreeListFormatRuleCollection) | A collection of conditional formatting rules. |

## Remarks

The conditional formatting feature allows  highlighting critical information, identifying trends and exceptions, and comparing data.

To apply style format rules to a TreeList, use the **FormatRules** collection. Each rule in this collection is specified by the [TreeListFormatRule](/WindowsForms/DevExpress.XtraTreeList.StyleFormatConditions.TreeListFormatRule) object. It identifies a column that provides values for the current rule ([TreeListFormatRule.Column](/WindowsForms/DevExpress.XtraTreeList.StyleFormatConditions.TreeListFormatRule.Column)), the rule type ([FormatRuleBase.Rule](/WindowsForms/DevExpress.XtraEditors.FormatRuleBase.Rule)) and other options.

The collection of format rules can be customized at design time and in code. To customize this collection at design time, you can use the **Style Format Rules** page of the [Tree List Designer](/WindowsForms/310/controls-and-libraries/tree-list/design-time-features/tree-list-designer), or the Format Rule Collection Editor invoked by clicking the ellipsis button for the **FormatRules** property.

![TreeListDesignerAppearanceCategoryFormatRulesPage](/WindowsForms/images/treelistdesignerappearancecategoryformatrulespage25389.png)
![TreeListFormatRuleCollectionEditorViaPropertiesGrid](/WindowsForms/images/treelistformatrulecollectioneditorviapropertiesgrid25390.png)

If the [TreeListOptionsMenu.ShowConditionalFormattingItem](/WindowsForms/DevExpress.XtraTreeList.TreeListOptionsMenu.ShowConditionalFormattingItem) property is enabled, an end-user can customize the format rules collection at runtime using the column’s context menu.

See the [Conditional Formatting](/WindowsForms/17866/controls-and-libraries/tree-list/feature-center/appearances-and-look-and-feel/appearances/conditional-formatting) document to learn more.

See Also

[Conditional Formatting](/WindowsForms/17866/controls-and-libraries/tree-list/feature-center/appearances-and-look-and-feel/appearances/conditional-formatting)

[Tree List Designer](/WindowsForms/310/controls-and-libraries/tree-list/design-time-features/tree-list-designer)

[TreeList Class](/WindowsForms/DevExpress.XtraTreeList.TreeList)

[TreeList Members](/WindowsForms/DevExpress.XtraTreeList.TreeList._members)

[DevExpress.XtraTreeList Namespace](/WindowsForms/DevExpress.XtraTreeList)