This project has moved and is read-only. For the latest updates, please go here.

Changing editors in a PropertyGrid

Nov 6, 2012 at 6:32 PM

I have several doubles that I want to display in my PropertyGrid, but I dont want to use the DoubleUpDownEditor.  All I want is a textbox.  I dont need the up and down arrows.


Is there a global setting that I can change that makes all numeric values display in a textbox?


Barring that, is there a way to change this property by property? 

Nov 7, 2012 at 3:08 PM

You can specify a TextBox thru the PropertyGrid.EditorDefinitions property.


To have some input validation and no exceptions, you can still use the DoubleUpDown control but set the "ShowButtonSpinner" and optionally  "AllowSpin" properties to false

Nov 7, 2012 at 5:20 PM

I've not been able to create a propertygrid through xaml, I get error messages that the name doesnt exist, so I've been creating it programmatically.  Can you point me to an example of programmatically changing the editordefinitions?