Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

C#
[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">
    <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