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.v24.2.dll
Declaration
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HtmlImages property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.