Skip to main content
A newer version of this page is available. .
All docs
V22.1

BaseListBoxControl.HtmlTemplates Property

Stores HTML and CSS-based templates used to render listbox items.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v22.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Layout")]
public HtmlTemplateCollection HtmlTemplates { get; }

Property Value

Type Description
DevExpress.Utils.Html.HtmlTemplateCollection

A collection of HTML and CSS-based templates used to render listbox items.

Remarks

Listbox items can be rendered from templates (regular templates or HTML and CSS-based templates). Use the HtmlTemplates collection to add HTML and CSS-based templates. The first element in this collection becomes the default item template.

Run Demo

Note

Support for HTML and CSS-based UI design in controls is under active development and is available as a Community Technology Preview (CTP). We appreciate your feedback on how you build desktop UIs with HTML and CSS.

You can click the ellipsis button for the HtmlTemplates property to invoke the HTML template editor and create a template:

ListBox - Html Templates - Designer

You can create multiple templates in the HtmlTemplates collection. In this case, you can handle the BaseListBoxControl.CustomItemTemplate event to apply different templates to different items.

Use the BaseListBoxControl.Templates collection to specify regular item templates. HTML and CSS-based templates have priority over regular templates.

See the following topic to learn more: Templated ListBox Items.

See Also