Back to Devexpress

TreeList.HtmlImages Property

windowsforms-devexpress-dot-xtratreelist-dot-treelist-520107f0.md

latest4.0 KB
Original Source

TreeList.HtmlImages Property

Gets or sets a collection of images that can be embedded in column/band headers and cells using the image tag.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

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

Declaration

csharp
[DefaultValue(null)]
public object HtmlImages { get; set; }
vb
<DefaultValue(Nothing)>
Public Property HtmlImages As Object

Property Value

TypeDefaultDescription
Objectnull

An image collection (DevExpress.Utils.ImageCollection or DevExpress.Utils.SvgImageCollection).

|

Remarks

You can use a set of HTML-inspired tags to format text in column/band headers and cells.

The TreeListOptionsView.AllowHtmlDrawHeaders property activates HTML formatting for column/band headers. To format cell text with HTML tags, use a RepositoryItemHypertextLabel as an in-place editor.

When you compose an HTML string, you can use the image tag to insert an image from an image collection and project’s resources into the text.

To insert an image from an image collection, do the following:

See HTML Text Formatting for more information.

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.

csharp
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 + ">";
vb
Dim imageName As String = "customer"
imageCollection1.AddImage(Image.FromFile("c:\customer-16x16.png"), imageName)

gridView1.OptionsView.AllowHtmlDrawHeaders = True
gridView1.HtmlImages = imageCollection1
columnCustomer.Caption = columnCustomer.GetCaption() & "<image=" & imageName & ">"

See Also

AllowHtmlDrawHeaders

HTML-inspired Text Formatting

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace