Skip to main content

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