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

TreeList.HtmlImages Property

Gets or sets a collection of images to be inserted into column headers using HTML tags.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v18.2.dll

Declaration

[DefaultValue(null)]
public ImageCollection HtmlImages { get; set; }

Property Value

Type Default Description
ImageCollection *null*

A ImageCollection object that stores a collection of images.

Remarks

The HTML formatting feature allows you to use a set of HTML tags to format text in column headers. This functionality is activated via the TreeListOptionsView.AllowHtmlDrawHeaders property. The image tag can be used to insert an image from an ImageCollection or from the project’s resources into the display text.

If you want to insert an image from an ImageCollection, create an ImageCollection object, add images to it and then assign this ImageCollection to the HtmlImages property. All images in the ImageCollection have names. Use these names to refer to specific images while using the image tag. See HTML Text Formatting to learn more.

Example

The following example shows how to display an image to the right of the Job Title column’s caption using HTML tags. The HTML formatting feature is enabled via the TreeListOptionsView.AllowHtmlDrawHeaders property.

TreeList-HtmlImages-ex

string imageName = "customer";
imageCollection1.AddImage(Image.FromFile("c:\\customer-16x16.png"), imageName);

treeList1.OptionsView.AllowHtmlDrawHeaders = true;
treeList1.HtmlImages = imageCollection1;
colJobTitle.Caption = colJobTitle.GetCaption() + "<image=" + imageName + ">";
See Also