PropertyGrid – NumericUpDown Range Editor

OK, that probably sounds like complete rubbish for a title, but I had to get the gist of it out there.

This set of classes that allows a .Net PropertyGrid (Written in C# but should be convertible into other .Net CLR’s) to have a field that is driven by a the NumericUpDown toolbox Form type (Not WPF).

It also allows direct edit, of the field and will then do range validation (and correction) of the value entered.
And, will work with any number that will go into a PropertyGrid, i.e. not limited to the UpDown decimal type.

Here’s an example of how the attributes can be added to an existing PropertyGrid field (in bold):


DescriptionAttribute("0 is automatic, use 1 for problem finding scenario’s.\rRange 0 <-> 32"),
DisplayName("Thread Count"), CategoryAttribute("Dokan"
Editor(typeof(NumericUpDownTypeEditor), typeof(UITypeEditor)), MinMaxAttribute
(0, 32)]
public ushort ThreadCount { get; set; }

This shows the TypeConverter to allow direct editing.
The UITypeEditor to show the NumericUpDown control.
And, the new attribute to set the range MinMaxAttribute

The MinMaxAttribute can also take a step and increment values (They default to 1 if not specified).

The classes are currently here:


Credit to the following sources:



One thought on “PropertyGrid – NumericUpDown Range Editor

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s