This is a migrated thread and some comments may be shown as answers.

Change default editor for float to be a RadNumericUpDown

2 Answers 106 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 11 May 2016, 06:45 PM

Trying out the property grid and haven't been able to figure out how I can override the default template for common .NET types such as float to use the RadNumericUpDown rather than a TextBox. I looked at setting a custom DataTemplateSelector as described here: http://docs.telerik.com/devtools/wpf/controls/radpropertygrid/features/datatemplateselector.html but this can only work if I know the property name. So my question is the following: how can I change the default float editor template in the property grid? I want to do this for integers, colors, and many more common types. I don't want to have to add custom attributes to all the properties either.

 

Thanks!

Guy

2 Answers, 1 is accepted

Sort by
0
Guy
Top achievements
Rank 1
answered on 11 May 2016, 06:59 PM

Going to answer my own question since I figured it out: It's possible using a custom data template selector and on each data template I have to use the AutoBind attached behavior, for example:

telerik:AutoBindBehavior.UpdateBindingOnElementLoaded="Value"

0
Stefan
Telerik team
answered on 12 May 2016, 01:53 PM
Hi Guy,

Thank you very much for sharing your solution with the community.

More information on the AutoBind Attached Behavior can be found here.

All the best,
Stefan X1
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Guy
Top achievements
Rank 1
Answers by
Guy
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or