Skip to main content

FormLayoutSettings<ModelType>.RequiredMarkDisplayMode Property

Gets or sets the required mark display mode.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public RequiredMarkMode RequiredMarkDisplayMode { get; set; }

Property Value

Type Description
RequiredMarkMode

One of the RequiredMarkMode enumeration values.

Available values:

Name Description
Auto

A required mark position is automatically defined, depending on the control settings.

None

All the required and optional marks are hidden.

All

The required and optional marks are displayed.

RequiredOnly

Only the required marks are displayed.

OptionalOnly

Only the optional marks are displayed.

Remarks

Use the RequiredMarkDisplayMode property to control how the mark should be displayed within the FormLayout extension.

The following example illustrates how to hide the required mark (*).

@Html.DevExpress().FormLayout(settings => {
    settings.Name = "FormLayout";
    settings.Items.Add(item => {
        item.Name = "ID";
        item.RequiredMarkDisplayMode = FieldRequiredMarkMode.Hidden; 
    });
    settings.Items.Add(item => {
        item.Name = "Name";
    });
}).GetHtml()

Online Demo

Form Layout - Data Binding

See Also