Back to Devexpress

TreeListAppearanceCollection Class

windowsforms-devexpress-dot-xtratreelist-f1fd8edb.md

latest4.2 KB
Original Source

TreeListAppearanceCollection Class

Provides the appearance settings used to paint the Tree List.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public class TreeListAppearanceCollection :
    TreeListBaseAppearanceCollection
vb
Public Class TreeListAppearanceCollection
    Inherits TreeListBaseAppearanceCollection

The following members return TreeListAppearanceCollection objects:

Remarks

The TreeListAppearanceCollection class introduces properties that specify how the Tree List’s visual elements such as its column headers, expand buttons, node cells are painted. Each property returns the AppearanceObject object whose attributes specify the corresponding element’s background and foreground colors, font settings, gradient mode, etc. For example, the TreeListAppearanceCollection.FocusedRow property provides the appearance settings used to paint the data cells within the currently focused node.

To access the Tree List’s appearance settings, use the TreeList.Appearance property. For more information on appearances, see the Appearances document.

The Tree List’s visual elements can also be custom painted via the custom draw events. Refer to the Custom Drawing document for detailed information.

Example

The following code shows how to use the EvenRow and OddRow properties to customize the appearance of even and odd rows in the TreeList. Note that these properties are in effect if the EnableAppearanceEvenRow and EnableAppearanceOddRow options are enabled.

csharp
treeList1.Appearance.EvenRow.BackColor = Color.PaleVioletRed;
treeList1.Appearance.OddRow.BackColor = Color.LightPink;
treeList1.OptionsView.EnableAppearanceEvenRow = true;
treeList1.OptionsView.EnableAppearanceOddRow = true;
vb
TreeList1.Appearance.EvenRow.BackColor = Color.PaleVioletRed
TreeList1.Appearance.OddRow.BackColor = Color.LightPink
TreeList1.OptionsView.EnableAppearanceEvenRow = True
TreeList1.OptionsView.EnableAppearanceOddRow = True

Inheritance

Object BaseAppearanceCollection DevExpress.XtraTreeList.TreeListBaseAppearanceCollection TreeListAppearanceCollection GanttControlAppearanceCollection

See Also

TreeListAppearanceCollection Members

Appearances

Custom Drawing

DevExpress.XtraTreeList Namespace