Skip to main content
A newer version of this page is available. .

TreeList.ImageIndexFieldName Property

Gets or sets the name of the field whose values represent select image indexes for corresponding nodes.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.1.dll

Declaration

[DefaultValue("ImageIndex")]
[XtraSerializableProperty]
public string ImageIndexFieldName { get; set; }

Property Value

Type Default Description
String "ImageIndex"

A string value specifying the name of the field that serves as the source of select image indexes.

Remarks

Each node can have three images associated with it. A standard image is replaced with the select image when a node is selected. The state image is displayed constantly. So, not more than two images can be displayed within the node at one time.

The source of standard images and select images is specified by the TreeList.SelectImageList property. Individual images are assigned to nodes by specifying the index of the desired image within the collection. This can be done in the following ways:

  • Assign the name of the field containing image indexes to the ImageIndexFieldName property. Each node value within this field will specify the image index for the corresponding node.

    If an image index is -1, the select image is used (see TreeListNode.SelectImageIndex). If the image index is less than -1 or exceeds the last available index, no image is painted for the node.

  • Use the TreeListNode.ImageIndex property of the nodes.
  • Handle the TreeList.GetSelectImage event.
  • Handle the TreeList.CustomDrawNodeImages event.

Note: the ways in which to assign images to nodes are listed by their priority. So, handling the TreeList.CustomDrawNodeImages event overrides all other settings.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ImageIndexFieldName 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.

See Also