DxDropDown.BodyTemplate Property
Specifies a template for the drop-down window’s body.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v22.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment<IPopupElementInfo> BodyTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<IPopupElementInfo> | The template content. |
Remarks
Use the BodyTemplate property to display any UI fragment (for instance, formatted text, images, or another component) in the body element of the DropDown. The template has the context parameter. You can use the parameter’s CloseCallback property to implement a custom close button.
<DxButton Id="showDDbutton" Click="() => IsOpen = true">Show DropDown</DxButton>
<DxDropDown @bind-IsOpen="@IsOpen"
Width="400"
HeaderVisible="true"
HeaderText="Edit Contact"
FooterVisible="true">
<BodyTemplate>
<SampleEditForm />
</BodyTemplate>
<FooterTextTemplate>
<DxButton RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="@context.CloseCallback" />
<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="@context.CloseCallback" />
</FooterTextTemplate>
</DxDropDown>
@code {
bool IsOpen { get; set; } = false;
}
The BodyTemplate property takes priority over the BodyText and BodyTextTemplate properties.
See Also