DxFormLayoutItem.ChildContent Property
Specifies item content.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
[Parameter]
public RenderFragment<object> ChildContent { get; set; }
#Property Value
Type | Description |
---|---|
Render |
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:
<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: Dx
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:
<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.