blazor-devexpress-dot-blazor-dot-dxformlayoutitem-362ad19b.md
Specifies item content.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public RenderFragment<object> ChildContent { get; set; }
| Type | Description |
|---|---|
| RenderFragment<Object> |
Content markup.
|
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 additional 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:
<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