Skip to main content
All docs
V24.2

AccordionControlHtmlTemplates.FooterElement Property

Specifies the default HTML-CSS template used to render elements when they are displayed within the control’s footer.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

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

Property Value

Type Description
HtmlTemplate

The HTML-CSS template used to render items in the control’s footer.

Remarks

AccordionControl can render its UI elements from HTML-CSS templates. The following properties allow you to define HTML templates for the footer panel and its elements:

AccordionControl - Footer Panel

HTML markup for the HtmlFooterElementTemplate template should contain an HTML element with the predefined “dx-item” identifier (id). This element’s size determines the footer item’s display size.

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

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

You can also specify different templates for different elements (items and groups). For this purpose, use the HtmlTemplateCollection 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}".

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>

You can also use the ${MyField1} syntax to mark an element as bound to a custom data source. The actual data for this element is set in the QueryHtmlElementData event handler.

<div class="acc_item">${MyField1}</div>
private void OnQueryHtmlElementData(object sender, QueryAccordionHtmlElementDataEventArgs e) {
    if (e.FieldName == "MyField1") {
        e.Value = "CustomData";
    }
}
See Also