Skip to main content
A newer version of this page is available. .

DxToolbarItem.Template Property

Specifies the template to display an item’s content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.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 provides 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 example below demonstrates how to add the Search text box to the Toolbar component.

<DxToolbar ItemRenderStyleMode="ToolbarRenderStyleMode.Plain">
    <Items>
        <DxToolbarItem>
            <Template>
                <div class="dxbs-textbox">
                    <input type="text" class="form-control" placeholder="Search...">
                    <span class="dxbs-feedback">
                        <span class="d-flex pl-2 pr-2" role="button" style="color:gray">
                            <span class="oi oi-magnifying-glass"></span>
                        </span>
                    </span>
                </div>
            </Template>
        </DxToolbarItem>
        <DxToolbarItem IconCssClass="oi oi-cog" Tooltip="Settings" />
    </Items>
</DxToolbar>

Toolbar Item Template

Run Demo: Toolbar - Item Templates

See Also