Back to Devexpress

CustomDrawNodeIndicatorEventArgs.ImageIndex Property

windowsforms-devexpress-dot-xtratreelist-dot-customdrawnodeindicatoreventargs.md

latest3.6 KB
Original Source

CustomDrawNodeIndicatorEventArgs.ImageIndex Property

Gets or sets the index of an image to be painted in the indicator cell.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
public int ImageIndex { get; set; }
vb
Public Property ImageIndex As Integer

Property Value

TypeDescription
Int32

The index of an image to be painted in the indicator cell. -1 if no image is displayed.

|

Remarks

An indicator cell can display one of three predefined images according to a node’s edit state. These images are accessible from the TreeListPainter.IndicatorImages collection. The ImageIndex property specifies the displayed image by its index. Supported image indexes are shown in the table below.

Image IndexNode Edit State
-1Not focused.
TreeListPainter.EditorIsInactiveIndicatorImageIndex constantA node is not being edited.
TreeListPainter.EditorIsActiveIndicatorImageIndex constantThe focused cell’s editor is active, but the editor’s value has not been changed yet.
TreeListPainter.EditorIsModifiedIndicatorImageIndex constantThe editor’s value has been changed, but the editor hasn’t been closed.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ImageIndex property.

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.

winforms-treelist-display-numbers-in-node-indicator/CS/WindowsApplication1/Form1.cs#L41

csharp
args.DisplayText = (tree.GetVisibleIndexByNode(e.Node) + 1).ToString();
    e.ImageIndex = -1;
}

winforms-treelist-display-numbers-in-node-indicator/VB/WindowsApplication1/Form1.vb#L38

vb
args.DisplayText =(tree.GetVisibleIndexByNode(e.Node) + 1).ToString()
    e.ImageIndex = -1
End Sub

See Also

IsNodeIndicator

Handled

CustomDrawNodeIndicatorEventArgs Class

CustomDrawNodeIndicatorEventArgs Members

DevExpress.XtraTreeList Namespace