Skip to main content

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

Specifies property value boundaries.

Namespace: DevExpress.Mvvm.DataAnnotations

Assembly: DevExpress.Mvvm.v24.1.dll

NuGet Packages: DevExpress.Mvvm, DevExpress.Win.Navigation

Declaration

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

Parameters

Name Type Description
builder PropertyMetadataBuilder<T, TProperty>

A property metadata builder instance.

minimum TProperty

The initial boundary.

maximum 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, 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