Back to Devexpress

TreeListColumn.ImageIndex Property

windowsforms-devexpress-dot-xtratreelist-dot-columns-dot-treelistcolumn-893865a5.md

latest3.4 KB
Original Source

TreeListColumn.ImageIndex Property

Use the ImageIndex propery accessible in TreeListColumn.ImageOptions to specify the index of the image from the TreeList.ColumnsImageList collection displayed in the column header.

Namespace : DevExpress.XtraTreeList.Columns

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
[Browsable(false)]
[DefaultValue(-1)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ImageList("Images")]
[XtraSerializableProperty]
public int ImageIndex { get; set; }
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<DefaultValue(-1)>
<XtraSerializableProperty>
<ImageList("Images")>
Public Property ImageIndex As Integer

Property Value

TypeDefaultDescription
Int32-1

An integer value specifying the image by its zero-based index in the source collection. -1 to not display an image.

|

Remarks

To display images within column headers, first assign an image list to the TreeList.ColumnsImageList property. Then use a column’s ImageIndex property to assign the index of the required image within this list.

You can also use the Image property accessible in TreeListColumn.ImageOptions to specify the column header image.

Tip

You can also assign an image by its name in the collection.

csharp
// The image collection is created and populated with images at design time.
barItem.ImageOptions.Image = imageCollection1["technology_32x32"]; 
// Assign an SVG image in the SvgCollection
// barItem.ImageOptions.SvgImage = svgCollection1["technology_32x32"];
vb
' The image collection is created and populated with images at design time.
barItem.ImageOptions.Image = imageCollection1("technology_32x32")
' Assign an SVG image in the SvgCollection
' barItem.ImageOptions.SvgImage = svgCollection1["technology_32x32"];

Read the following help topic for more information: Access and Use DevExpress Icons in Code.

See Also

ColumnsImageList

ImageOptions

TreeListColumn Class

TreeListColumn Members

DevExpress.XtraTreeList.Columns Namespace