DxFormLayout.Data Property

Specifies a data item that is bound to the Form Layout items.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public object Data { get; set; }

Property Value

Type Description
Object

A data item.

Remarks

The Data property specifies a data item from which the Form Layout retrieves its data. Form Layout items must be declared and bound to the data item fields using the Field property. Each item automatically displays a DevExpress data editor suitable for the target data type.

The following example illustrates how to bind the Form Layout to a data item.

<DxFormLayout Data="@editFormData" >
    <DxFormLayoutItem Field="@nameof(FormDataItem.Name)" ... />
    <DxFormLayoutItem Field="@nameof(FormDataItem.Birthday)" ... />
    <DxFormLayoutItem Field="@nameof(FormDataItem.Worked)" ... />
    <DxFormLayoutItem Field="@nameof(FormDataItem.Position)" ... />
</DxFormLayout>

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

Run Demo: Form Layout - Bind to Data

See Also