Change default editor for float to be a RadNumericUpDown

3 posts, 0 answers
  1. Guy
    Guy avatar
    16 posts
    Member since:
    Mar 2012

    Posted 11 May Link to this post

    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. Guy
    Guy avatar
    16 posts
    Member since:
    Mar 2012

    Posted 11 May in reply to Guy Link to this post

    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"

  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 12 May Link to this post

    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.
Back to Top