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

AccordionControlHtmlTemplates.MinimizedElement Property

Specifies the default HTML-CSS template used to render AccordionControl elements when the control is minimized.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v22.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Layout")]
public HtmlTemplate MinimizedElement { get; }

Property Value

Type Description
HtmlTemplate

The HTML-CSS template used to render AccordionControl elements when the control is minimized.

Remarks

AccordionControl can render its UI elements from HTML-CSS templates. Use the HtmlMinimizedElementTemplate property to specify the default template for AccordionControl elements when the control is minimized (see OptionsMinimizing.State).

HTML markup for the MinimizedElement template should contain an HTML element with the predefined “dx-item” identifier (id). This element’s size determines the display size of AccordionControl items in the minimized state.

The following example shows a template for the MinimizedElement property. The HTML code uses the “dx-item” id to mark an HTML element that determines the display size of AccordionControl items:

<div class="container">
    <div id="dx-item" class="container">
        <div  class="dx-item">
            <div class="item_layout">
                <img class="item_image" src="${Image}">
                <div class="highlight"></div>
            </div>
        </div>
    </div>
</div>

You can also specify different templates for different elements (items and groups). For this purpose, use the AccordionControl.HtmlTemplates.Templates collection to create templates beforehand. Then, handle the AccordionControl.QueryItemTemplate event to supply templates to elements dynamically.

Display an Element’s Text, Images, and Custom Data

When you specify templates for AccordionControl elements, you can use the data binding syntax (${PropertyName}) to display text, images, and custom values (AccordionControlElementBase.Tag) of these elements.

${Text} — Inserts an element’s text (AccordionControlElementBase.Text).

${Image} — Inserts an element’s image specified in the AccordionControlElementBase.ImageOptions object. Use the img tag to insert an image, for example, as follows: <img src="${Image}".

${Tag} — Inserts a string representation of the object stored in the AccordionControlElementBase.Tag property.

${MyField1} — Inserts a ‘MyField1’ property value of a custom object stored in an element’s AccordionControlElementBase.Tag property.

For example, the following HTML markup defines a div container that displays an element’s image followed by its text:

<div class="item">
    <div class="item_layout">
        <img class="item_image" src="${Image}">
        <div class="item_text">${Text}</div>
    </div>
</div>
See Also