RepositoryItem.HtmlImages Property

Gets or sets a collection of images that can be embedded in the editor's display text or the display text of the editor's items, using the image tag.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

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

Property Value

Type Default Description
Object

null

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

Remarks

A set of HTML-inspired tags allows you to format the editor's display text and the display text of the editor's items. To enable HTML text formatting, see the RepositoryItem.AllowHtmlDraw property.

When you compose an HTML string, you can use the image tag to insert an image. Target images can be stored in an image collection and project resources.

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

  • Create an image collection (ImageCollection or SvgImageCollection) and populate it with images.
  • Assign the collection to the HtmlImages property. You can use HTML formatting (and embed images) in cells in container controls (Data Grid, Tree List, etc.) with RepositoryItemHypertextLabel. In this case, you can assign the image collection either to the RepositoryItemHypertextLabel.HtmlImages property or to the container control's HtmlImages property (for instance, BaseView.HtmlImages).
  • When you use the image tag, address a target image by its name (image names can be obtained from the image collection).
buttonEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
buttonEdit1.Properties.AllowHtmlDraw = DevExpress.Utils.DefaultBoolean.True;
buttonEdit1.Properties.HtmlImages = imageCollection1;
buttonEdit1.Text = "<image=apply.png> Applied";

See HTML Text Formatting for more information.

See Also