This project has moved. For the latest updates, please go here.

Changing editors in a PropertyGrid

Nov 6, 2012 at 5: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 2:08 PM

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

See http://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid&referringTitle=Home#custom_editors_dataTempates

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 4: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?