A newer version of this page is available. Switch to the current version.

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.

See Also