Skip to main content
A newer version of this page is available.
All docs
V20.2

DxFormLayoutItem.ReadOnly Property

Specifies whether a user can change the Form Layout item’s edit value.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public bool ReadOnly { get; set; }

Property Value

Type Default Description
Boolean false

true, to activate read-only mode; otherwise, false.

Remarks

Set the ReadOnly property to true to activate read-only mode. In this mode, users cannot change the layout item’s edit value.

<DxFormLayout Data="@editFormData">
            <DxFormLayoutItem Field="@nameof(FormDataItem.Name)" Caption="Contact Name:" />
            <DxFormLayoutItem Field="@nameof(FormDataItem.BirthDate)" Caption="Birth Date:" ReadOnly="true"/>
            <DxFormLayoutItem Field="@nameof(FormDataItem.YearsWorked)" Caption="Years Worked:" />
            ...
</DxFormLayout>

Form Layout Item Read-Only Mode

The ReadOnly property only affects an auto-generated editor. If you specify a custom editor, use its ReadOnly property instead (for example, DxDateEdit.ReadOnly).

<DxFormLayout>
    <DxFormLayoutItem Caption="Contact Name:">
        <Template>
            <DxTextBox @bind-Text="@Name"></DxTextBox>
        </Template>
    </DxFormLayoutItem>

    <DxFormLayoutItem Caption="Email:">
        <Template>
           <DxTextBox @bind-Text="@Email"></DxTextBox>
        </Template>
    </DxFormLayoutItem>

    <DxFormLayoutItem Caption="Birth Date:">
        <Template>
            <DxDateEdit @bind-Date="@BirthDate" ReadOnly="true"></DxDateEdit>
        </Template>
    </DxFormLayoutItem>

    ...

</DxFormLayout>

Form Layout Item Read-Only Mode

See Also