Back to Devexpress

FormLayoutItemBase.Enabled Property

blazor-devexpress-dot-blazor-dot-base-dot-formlayoutitembase-7e25dc29.md

latest2.8 KB
Original Source

FormLayoutItemBase.Enabled Property

Specifies whether the auto-generated editors in the Form Layout are enabled.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool Enabled { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true if the editors are enabled; otherwise, false.

|

Remarks

Use the Enabled property to enable or disable auto-generated editors in the Form Layout. Users cannot focus disabled editors.

razor
<DxFormLayout Data="forecast">
    <DxFormLayoutGroup Caption="Weather Forecast">
        <DxFormLayoutItem Caption="Date" Field="@nameof(WeatherForecast.Date)" ReadOnly="true" />
        <DxFormLayoutItem Caption="Temperature" Field="@nameof(WeatherForecast.TemperatureC)" Enabled="false" />
    </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};
}

You can also disable all auto-generated editors in groups, tabs and tab pages:

razor
<DxFormLayout Data="forecast">
    <DxFormLayoutItem Caption="Date" Field="@nameof(WeatherForecast.Date)" />
    <DxFormLayoutGroup Caption="Information" Enabled="false">
        <DxFormLayoutItem Caption="Temperature" Field="@nameof(WeatherForecast.TemperatureC)" />
        <DxFormLayoutItem Caption="Precipitation" Field="@nameof(WeatherForecast.Precipitation)" />
    </DxFormLayoutGroup>
</DxFormLayout>

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.

ComponentProperty
Form LayoutEnabled
Tab PagesEnabled
Tab PageEnabled
GroupEnabled
ItemEnabled
Editor<Editor_name>.Enabled

See Also

FormLayoutItemBase Class

FormLayoutItemBase Members

DevExpress.Blazor.Base Namespace