DxFormLayout.ReadOnly Property
In This Article
Specifies whether the Form Layout activates read-only mode for all auto-generated editors.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
[DefaultValue(false)]
[Parameter]
public bool ReadOnly { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
#Remarks
Set the ReadOnly
property to true
to activate read-only mode in auto-generated editors. In this mode, the editors are protected from value changes but users still can focus input UI elements.
Razor
<DxFormLayout Data="forecast" ReadOnly="true">
<DxFormLayoutGroup Caption="Weather Forecast">
<DxFormLayoutItem Caption="Date" Field="@nameof(WeatherForecast.Date)" />
<DxFormLayoutGroup Caption="Information">
<DxFormLayoutItem Caption="Temperature" Field="@nameof(WeatherForecast.TemperatureC)" />
<DxFormLayoutItem Caption="Precipitation" Field="@nameof(WeatherForecast.Precipitation)" />
</DxFormLayoutGroup>
</DxFormLayoutGroup>
</DxFormLayout>
@code{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public double Precipitation { get; set; }
}
WeatherForecast forecast = new WeatherForecast() { Date = new DateTime(2020, 05, 11), TemperatureC = 20, Precipitation = 5};
}
The Form Layout and its elements (tabs, tab pages, and groups) apply this property’s value to nested elements. You can specify the corresponding property for a nested element to override this setting.
Component | Property |
---|---|
Form Layout | Read |
Tab Pages | Read |
Tab Page | Read |
Group | Read |
Item | Read |
Editor | <Editor_name>. |
See Also