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

DxEditSettings.ReadOnly Property

Specifies whether a user can change an editor’s value.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(null)]
[Parameter]
public bool? ReadOnly { get; set; }

#Property Value

Type Default Description
Nullable<Boolean> null

true to prevent users from changing the editor value; false to allow users to change the editor value; null to inherit the value from the column’s ReadOnly property.

#Remarks

In read-only mode, the editor displays a value but does not allow users to change it. Use the ReadOnly property to activate or deactivate this mode. If the editor’s ReadOnly property unspecified, the column’s ReadOnly property value determines whether the editor is in read-only mode.

Note that the ReadOnly property does not affect the editor displayed in the filter row. To hide the filter row editor, set the FilterRowEditorVisible property to false.

razor
<DxGrid Data="@products" 
        ShowFilterRow="true" 
        EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="ProductID" >
            <EditSettings>
                <DxSpinEditSettings ShowSpinButtons="false" ReadOnly="true" NullText="Type the ID" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="UnitsInOrder" />
    </Columns>
</DxGrid>

Modified Editors

To enable or disable the read-only mode at runtime, use the IEditSettings.ReadOnly property.

#Implements

See Also