System.ComponentModel.DataAnnotations.RangeAttribute does not have any effect

Grids for WPF Forum

Posted 9 years ago by Neil Larson
Version: 15.1.0623

I have created a property (see below) that shows ok in the grid, but am having trouble getting it to validate against the provided range. Is there a way to enforce the range in the property grid?

private int _Cue;
[Description("Cue to lockout")]
[Range(1, 48)]
public int Cue
return _Cue;
if(_Cue == value)

_Cue = value;
RaisePropertyChanged(() => Cue);



Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Neil,

Sorry but we don't handle that attribute.  But what you could do is use our Int32EditBox in your PropertyGrid value template, and give the edit box a Minimum and Maximum based on your needs.  That would give a nice UI for the property and would restrict it to the desired range.

Actipro Software Support

The latest build of this product (v24.1.2) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.