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

DxFormLayoutItem.ChildContent Property

Specifies item content.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

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

#Property Value

Type Description
RenderFragment<Object>

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
<DxFormLayout Data="@editFormData">
    @* ... *@
    <DxFormLayoutItem Field="@nameof(FormDataItem.Position)" Caption="Position:" ColSpanMd="6">
        <ChildContent>
            <DxComboBox Data="@(new List<string>() { "Sales Representative", "Designer" })"
                        Value="@(((string)((ValueEditContext)context).Value))"
                        ValueChanged="@((string value) => ((ValueEditContext)context).OnChanged(value))">
            </DxComboBox>
        </ChildContent>
    </DxFormLayoutItem>
</DxFormLayout>

@code {
    FormDataItem editFormData = new FormDataItem() {
        Name = "Nancy Davolio",
        BirthDate = DateTime.Now.AddYears(-30),
        YearsWorked = 3,
        Position = "Sales Representative"
    };
}

Note

Nested layout elements must conform to the component layout structure. Refer to the following topic for more information: DxFormLayout - Layout Structure.

This property is equivalent to the Template property. You can omit both <ChildContent> and <Template> tags, and specify the markup directly in the <DxFormLayoutItem> tag:

Razor
<DxFormLayout Data="@editFormData">
    @* ... *@
    <DxFormLayoutItem Field="@nameof(FormDataItem.Position)" Caption="Position:" ColSpanMd="6">
        <DxComboBox Data="@(new List<string>() { "Sales Representative", "Designer" })"
                    Value="@(((string)((ValueEditContext)context).Value))"
                    ValueChanged="@((string value) => ((ValueEditContext)context).OnChanged(value))">
        </DxComboBox>
    </DxFormLayoutItem>
</DxFormLayout>

@code {
    FormDataItem editFormData = new FormDataItem() {
        Name = "Nancy Davolio",
        BirthDate = DateTime.Now.AddYears(-30),
        YearsWorked = 3,
        Position = "Sales Representative"
    };
}

Note: you need to specify the Template tag when you use the CaptionTemplate.

See Also