Skip to main content

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.Field Property

Specifies a data source field assigned to the current layout item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(null)]
[Parameter]
public string Field { get; set; }

#Property Value

Type Default Description
String null

The data source field name.

#Remarks

You can use the Form Layout component to display and edit data from an external source. In this case, use the Field property to declare and bind Form Layout items to data source fields.

Razor
<DxFormLayout Data="@editFormData" CaptionPosition="CaptionPosition.Vertical">
    <DxFormLayoutItem Field="@nameof(FormDataItem.Name)" Caption="Contact Name:" />
    <DxFormLayoutItem Field="@nameof(FormDataItem.Birthday)" Caption="Birthday:"  />
    <DxFormLayoutItem Field="@nameof(FormDataItem.Worked)" Caption="Worked year(s):" />
</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