Skip to main content

ValidationRulesFactory.AddRequired() Method

Adds a validation rule that checks if an editor’s value is not null.

Namespace: DevExtreme.AspNet.Mvc.Factories

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public RequiredRuleBuilder AddRequired()

Returns

Type Description
RequiredRuleBuilder

A RequiredRuleBuilder instance.

Remarks

Refer to Validate Editors Used in Composite Controls for more information.

@(Html.DevExtreme().DataGrid()
    .Columns(columns => {
        columns.Add().ValidationRules(rules => {
            rules.AddRequired()
                // call methods to specify nested options
            });
    })
)
See Also