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

PropertyMetadataBuilderExtensions.InRange<T, TProperty>(PropertyMetadataBuilder<T, Nullable<TProperty>>, Nullable<TProperty>, Nullable<TProperty>, Func<String>) Method

Specifies property value boundaries.

Namespace: DevExpress.Mvvm.DataAnnotations

Assembly: DevExpress.Mvvm.v18.2.dll

Declaration

public static PropertyMetadataBuilder<T, TProperty?> InRange<T, TProperty>(
    this PropertyMetadataBuilder<T, TProperty?> builder,
    TProperty? minimum,
    TProperty? maximum,
    Func<string> errorMessageAccessor = null
)
    where TProperty : struct, IComparable

Parameters

Name Type Description
builder PropertyMetadataBuilder<T, Nullable<TProperty>>

A property metadata builder instance.

minimum Nullable<TProperty>

The initial boundary.

maximum Nullable<TProperty>

The final boundary.

Optional Parameters

Name Type Default Description
errorMessageAccessor Func<String> *null*

A function that returns an error message.

Type Parameters

Name
T
TProperty

Returns

Type Description
PropertyMetadataBuilder<T, Nullable<TProperty>>

The property metadata builder instance.

Remarks

If the property value is outside the specified boundaries, an error message is shown.

The InRange<T, TProperty> property is recognized by the GridControl, TreeListControl and PropertyGridControl.

See Also