Skip to main content
All docs
V25.1
  • DxDropDown.BodyContentTemplate Property

    Specifies a template for content of the drop-down window’s body.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [Parameter]
    public RenderFragment<IPopupElementInfo> BodyContentTemplate { get; set; }

    Property Value

    Type Description
    RenderFragment<IPopupElementInfo>

    The body content.

    Remarks

    Use the BodyContentTemplate property to display any render fragment in the drop-down body’s content area. This template does not affect the default content area rendering (that is, paddings, alignment, etc.)

    The BodyContentTemplate accepts an IPopupElementInfo object as the context parameter. You can use the parameter’s CloseCallback property to implement the Close button.

    <DxButton Id="showDDbutton" Click="() => IsOpen = true">Show DropDown</DxButton>
    <DxDropDown @bind-IsOpen="@IsOpen"
                Width="400"
                HeaderVisible="true"
                HeaderText="Edit Contact"
                FooterVisible="true">
        <BodyContentTemplate>
            <SampleEditForm />
        </BodyContentTemplate>
        <FooterContentTemplate>
            <DxButton RenderStyle="ButtonRenderStyle.Primary" Text="OK" Click="@context.CloseCallback" />
            <DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Cancel" Click="@context.CloseCallback" />
        </FooterContentTemplate>
    </DxDropDown>
    
    @code {
        bool IsOpen { get; set; } = false;
    }
    

    Blazor DropDown Body Content Template

    See Also