DxDropDownButtonBase.DropDownContentTemplate Property
Specifies a template for the drop-down window content.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(null)]
[Parameter]
public RenderFragment DropDownContentTemplate { get; set; }
Property Value
Type | Default | Description |
---|---|---|
RenderFragment | null | 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:
- DxDropDownButton
- A toggleable button that reveals a drop-down element with a list of commands or custom content.
- DxSplitButton
- A composite control that consists of a primary button and a toggleable secondary button that reveals a drop-down element.
- DxDropDownButtonItem
- Defines 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:
<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