Back to Devexpress

TreeListOptionsView.RowImagesShowMode Property

windowsforms-devexpress-dot-xtratreelist-dot-treelistoptionsview-310b4ee2.md

latest6.1 KB
Original Source

TreeListOptionsView.RowImagesShowMode Property

Gets or sets whether to show row images in row indents or in row cells.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
[DefaultValue(RowImagesShowMode.Default)]
[XtraSerializableProperty]
public virtual RowImagesShowMode RowImagesShowMode { get; set; }
vb
<DefaultValue(RowImagesShowMode.Default)>
<XtraSerializableProperty>
Public Overridable Property RowImagesShowMode As RowImagesShowMode

Property Value

TypeDefaultDescription
DevExpress.XtraTreeList.RowImagesShowModeDefault

Default or InIndent to display row images in the indent area; InCell to display row images in row cells.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to RowImagesShowMode
TreeList

.OptionsView .RowImagesShowMode

|

Remarks

Nodes can display the following icons:

  • Select Image - two icons that automatically switch when a node gets / loses the focus.
  • State Image - any custom icon.

Node Image Location

Use the TreeList.OptionsView.RowImagesShowMode property to specify where to display node images:

  • InIndent — images are displayed in the indent area.

  • InCell — images are displayed within cells.

Example

The code below shows how to assign select and state images to nodes.

csharp
using DevExpress.XtraTreeList.Nodes;

// Data source for select (left) images.
treeList1.SelectImageList = imageCollection1;
// Use the data source to assign select images to nodes.
// Data source fields do NOT allow you to specify
// two images that depend on the focus.
// This property has priority over the node's
// ImageIndex and SelectImageIndex properties.
treeList1.ImageIndexFieldName = "ImageIndex";
// Data source for state (right) images.
treeList1.StateImageList = imageCollection1;
// Use the Load event to assign images to nodes.
treeList1.Load += TreeList1_Load;

private void TreeList1_Load(object sender, EventArgs e) {
    foreach (TreeListNode node in treeList1.Nodes) {
        // The left image displayed when the node is NOT focused.
        node.ImageIndex = 0;
        // The left image displayed when the node is focused.
        node.SelectImageIndex = 1;
        // The right image that does not depend on the focus.
        node.StateImageIndex = 2;
    }
}
vb
Imports DevExpress.XtraTreeList.Nodes

' Data source for select (left) images.
treeList1.SelectImageList = imageCollection1
' Use the data source to assign select images to nodes.
' Data source fields do NOT allow you to specify
' two images that depend on the focus.
' This property has priority over the node's
' ImageIndex and SelectImageIndex properties.
treeList1.ImageIndexFieldName = "ImageIndex"
' Data source for state (right) images.
treeList1.StateImageList = imageCollection1
' Use the Load event to assign images to nodes.
AddHandler treeList1.Load, AddressOf TreeList1_Load

Private Sub TreeList1_Load(ByVal sender As Object, ByVal e As EventArgs)
    For Each node As TreeListNode In treeList1.Nodes
        ' The left image displayed when the node is NOT focused.
        node.ImageIndex = 0
        ' The left image displayed when the node is focused.
        node.SelectImageIndex = 1
        ' The right image that does not depend on the focus.
        node.StateImageIndex = 2
    Next node
End Sub

See Also

Node Image

SelectImageList

StateImageList

ImageIndex

SelectImageIndex

StateImageIndex

ImageIndexFieldName

GetSelectImage

GetStateImage

HierarchyColumnIndent

ShowHierarchyIndentationLines

ShowHorzLines

ShowVertLines

ShowFirstLines

ShowTreeLines

TreeListOptionsView Class

TreeListOptionsView Members

DevExpress.XtraTreeList Namespace