DxWindow.BodyTemplate Property
Specifies a template for the window’s body. Replaces the default render fragment (including paddings, scrollbars, etc.)
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment<IPopupElementInfo> BodyTemplate { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<IPopupElementInfo> | The body template. |
Remarks
Use the BodyTemplate
property to display any render fragment in the window’s body element. This template changes the default body element rendering, including paddings, scrollbar, and inner content alignment. If you need to place custom content in the window’s body element but retain the default rendering of UI elements in it, use the BodyContentTemplate instead.
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Click="() => WindowVisible = !WindowVisible">SHOW A WINDOW</DxButton>
<DxWindow @bind-Visible=WindowVisible
HeaderText="Edit Contact"
Width="500px">
<BodyTemplate Context="Context">
<DxFormLayout>
<DxFormLayoutItem Caption="Contact Name:" ColSpanMd="12">
<DxTextBox Text="Nancy Davolio" />
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Birth Date:" ColSpanMd="12">
<DxDateEdit Date="DateTime.Now.AddYears(-30)" />
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Years Worked:" ColSpanMd="12">
<DxSpinEdit Value="3" />
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Email:" ColSpanMd="12">
<DxTextBox Text="NancyDavolio@sample.com" />
</DxFormLayoutItem>
</DxFormLayout>
</BodyTemplate>
</DxWindow>
@code {
bool WindowVisible { get; set; } = false;
}
The BodyTemplate
property has priority over the BodyText, BodyContentTemplate, and BodyTextTemplate properties.