Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxDropDown.ChildContent Property

Specifies body content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment ChildContent { get; set; }

#Property Value

Type Description
RenderFragment

Content markup.

#Remarks

The ChildContent component parameter can store custom component content that does not belong to other component’s RenderFragment properties as shown below:

Razor
<DxButton Click="() => IsOpen = !IsOpen"
          RenderStyle="ButtonRenderStyle.Secondary">SHOW A DROPDOWN</DxButton>

<DxDropDown @bind-IsOpen="@IsOpen"
            Id="dropDown-overview">
    <ChildContent>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Mauris sit amet metus velnisi blandit tincidunt vel efficitur purus.
        Nunc nec turpis tempus, accumsan orci auctor,
        imperdiet mauris. Fusce id purus magna.
    </ChildContent>
</DxDropDown>

@code {
    bool IsOpen { get; set; } = false;
}

Blazor DropDown Body Template

Note

Since ChildContent contains nested markup of its parent class, the template content must conform to HTML semantics.

This property is equivalent to the BodyContentTemplate property; however, we recommend that you explicitly specify BodyContentTemplate in the markup. This notation allows you to specify the following templates on the component level:

Razor
<DxButton Click="() => IsOpen = !IsOpen"
          RenderStyle="ButtonRenderStyle.Secondary">SHOW A DROPDOWN</DxButton>

<DxDropDown @bind-IsOpen="@IsOpen"
            Id="dropDown-overview">
    <BodyContentTemplate>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        Mauris sit amet metus velnisi blandit tincidunt vel efficitur purus.
        Nunc nec turpis tempus, accumsan orci auctor,
        imperdiet mauris. Fusce id purus magna.
    </BodyContentTemplate>
</DxDropDown>

@code {
    bool IsOpen { get; set; } = false;
}
See Also