Skip to main content

DxToolbarItem.Template Property

Specifies the template to display an item’s content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment<IToolbarItemInfo> Template { get; set; }

Property Value

Type Description
RenderFragment<IToolbarItemInfo>

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

Remarks

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

The following code snippet adds the DxSearchBox component to the Toolbar component.

<DxToolbar ItemRenderStyleMode="ToolbarRenderStyleMode.Plain"
           Title="DevExpress Logo">
    <TitleTemplate>
        <div class="icon-logo" role="img" aria-label="@context"></div>
    </TitleTemplate>
    <Items>
        <DxToolbarItem BeginGroup="true"
                       Alignment="ToolbarItemAlignment.Right">
            <Template>
                <div class="d-flex flex-row align-items-center h-100">
                    <DxSearchBox CssClass="search py-0" aria-label="Search" />
                </div>
            </Template>
        </DxToolbarItem>
        <DxToolbarItem IconCssClass="tb-icon tb-icon-refresh"
                       Tooltip="Refresh"
                       Alignment="ToolbarItemAlignment.Right"
                       BeginGroup="true" />
        <DxToolbarItem IconCssClass="tb-icon tb-icon-settings"
                       Tooltip="Settings" />
    </Items>
</DxToolbar>

Toolbar Item Template

Run Demo: Toolbar - Templates

See Also