windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrolhtmltemplates-b5b50609.md
Specifies the default HTML-CSS template used to render AccordionControl elements when the control is minimized.
Namespace : DevExpress.XtraBars.Navigation
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Layout")]
public HtmlTemplate MinimizedElement { get; }
<DXCategory("Layout")>
Public ReadOnly Property MinimizedElement As HtmlTemplate
| Type | Description |
|---|---|
| HtmlTemplate |
The HTML-CSS template used to render AccordionControl elements when the control is minimized.
|
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">
<div class="highlight"></div>
</div>
</div>
</div>
</div>
.container {
display: flex;
}
.item_layout {
display: flex;
flex-direction:column;
align-items: center;
}
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.
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: `
<div class="item_layout">
<div class="item_text">${Text}</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";
}
}
Private Sub OnQueryHtmlElementData(ByVal sender As Object, ByVal e As QueryAccordionHtmlElementDataEventArgs)
If e.FieldName = "MyField1" Then
e.Value = "CustomData"
End If
End Sub
See Also
AccordionControlHtmlTemplates Class