Skip to main content
A newer version of this page is available. .

ValidationRulesFactory.AddStringLength() Method

Adds a validation rule that checks if the length of an editor’s value does not exceed the specified limit.

Namespace: DevExtreme.AspNet.Mvc.Factories

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public StringLengthRuleBuilder AddStringLength()

Returns

Type Description
StringLengthRuleBuilder

A StringLengthRuleBuilder instance.

Remarks

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

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