Back to Devexpress

DxDropDownButtonBase.DropDownContentTemplate Property

blazor-devexpress-dot-blazor-dot-dxdropdownbuttonbase-5800fb86.md

latest2.5 KB
Original Source

DxDropDownButtonBase.DropDownContentTemplate Property

Specifies a template for the drop-down window content.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public RenderFragment DropDownContentTemplate { get; set; }

Property Value

TypeDefaultDescription
RenderFragmentnull

The template content.

|

Remarks

Use the DropDownContentTemplate property to display custom content within the target element’s drop-down window. The following components implement the DropDownContentTemplate property:

DxDropDownButtonA toggleable button that reveals a drop-down element with a list of commands or custom content.DxSplitButtonA composite control that consists of a primary button and a toggleable secondary button that reveals a drop-down element.DxDropDownButtonItemDefines a drop-down list item. Used in DxDropDownButton or DxSplitButton.

Example

The following code snippet displays a search box within the Click to search item’s drop-down window in the DxDropDownButton component:

razor
<DxDropDownButton Text="Blazor Components"
                  RenderStyle="ButtonRenderStyle.Secondary">
    <Items>
        <DxDropDownButtonItem Text="Documentation" />
        <DxDropDownButtonItem Text="Demos" />
        <DxDropDownButtonItem Text="Click to search">
            <DropDownContentTemplate>
                <div class="d-flex flex-row align-items-center h-100">
                    <DxSearchBox CssClass="search py-0" aria-label="Search" />
                </div>
            </DropDownContentTemplate>
        </DxDropDownButtonItem>
    </Items>
</DxDropDownButton>

See Also

DxDropDownButtonBase Class

DxDropDownButtonBase Members

DevExpress.Blazor Namespace