Skip to main content

DxToolbarItem.Template Property

Specifies the template to display an item’s content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.dll

NuGet Package: DevExpress.Blazor


public RenderFragment<IToolbarItemInfo> Template { get; set; }

Property Value

Type Description

The template content for an object of the IToolbarItemInfo type that stores information about an item (the text, state, icon, etc.)


Use the Template property to completely override an individual item’s content, including text, icon, child item, etc.

The example below demonstrates how to add the Search text box to the Toolbar component.

<DxToolbar ItemRenderStyleMode="ToolbarRenderStyleMode.Plain"
           Title="DevExpress Logo">
        <div class="icon-logo" role="img" aria-label="@context"></div>
        <DxToolbarItem BeginGroup="true"
                <div class="d-flex flex-row align-items-center h-100">
                    <SearchItem CssClass="py-0" />
        <DxToolbarItem IconCssClass="tb-icon tb-icon-refresh"
                       BeginGroup="true" />
        <DxToolbarItem IconCssClass="tb-icon tb-icon-settings"
                       Tooltip="Settings" />
<div class="search @CssClass">
    <input type="text" class="form-control form-control-sm search-input" placeholder="Search...">
    <span class="search-button d-flex ps-2 pe-2 me-1">
        <span class="search-icon"></span>

@code {
    public string CssClass { get; set; }

Toolbar Item Template

Run Demo: Toolbar - Templates

See Also