Custom property editors

8 posts, 1 answers
  1. Louis
    Louis avatar
    24 posts
    Member since:
    Oct 2010

    Posted 12 Jul 2011 Link to this post

    So glad to see you guys working on this new control!! 

    We are currently using the project at for our property grid.  One of the nice things about it is we can develop custom dialogs/editors for properties.  For example, we have a hierarchy of busines divisions/groups/teams containing hundreds of nodes.  We can create a custom dialog to let the user drill through a RadTreeView hooked up to a web service using LoadOnDemand to find a particular node.  We can then have a property of type Team, and tell the property grid that objects of type Team should use the custom editor.

    Another property editor we need is multi-select.  In the Attribute declaration for the property we could specify a delegate to return a List of objects, and the property editor would basically look like a multi-select combo box.  We can code this up ourselves if necessary, we just need the attribute support baked in.

    Would love to see you guys get custom editor support in your PropertyGrid!

    We love using your controls!
  2. Answer
    Pavel Pavlov
    Pavel Pavlov avatar
    2039 posts

    Posted 14 Jul 2011 Link to this post

    Hello Louis,
    I believe even the current version of RadPropertyGrid allows placement of custom editors.
    You can place any content as editor with just a few lines of code. For example the Color picker in this online demo is placed using this approach . There is source code available as well.

    Best wishes,
    Pavel Pavlov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft R3 2016 release webinar banner
  4. Louis
    Louis avatar
    24 posts
    Member since:
    Oct 2010

    Posted 18 Jul 2011 Link to this post

    Thanks, I'll take a look.
  5. Charles Willwerth
    Charles Willwerth avatar
    3 posts
    Member since:
    Mar 2010

    Posted 11 Nov 2011 Link to this post

    What would be VERY nice is if you could connect the dots a little more in regards to a property editor. The nice thing about the open source property viewer is that you could decorate one of your object's property with the SL30PropertyGrid.Editor(typeof(SomeEditor)) attribute to define how it should be displayed in the property browser.

    Your example, and hence how the control is designed today, prefers to define the editor in the AutoGeneratingPropertyDefinition method [when you have more than one object type bound to a particular property editor]. It makes more sense for the objects you are "property browsing" to themselves define how they should be displayed and the logic for that display should be in the objects. The attraction of this approach grows as you need more and more different object types [with custom editors] bound to the property browser.
  6. Ivan Ivanov
    Ivan Ivanov avatar
    1116 posts

    Posted 11 Nov 2011 Link to this post

    Hello Shaune Donohue,

    We have discussed introducing a uniform approach to defining editor templates for RadPropertyGrid and evaluating the recent feedback, we have come to the conclusion that the TemplateSelector approach would be most convenient one for our customers. We have just started working upon this feature, so it will be available in some of our future releases. We highly appreciate your feedback on this term and we would be glad to hear your opinion on the described feature.

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  7. Jason
    Jason avatar
    9 posts
    Member since:
    Jul 2008

    Posted 16 Nov 2011 Link to this post

    A uniform approach would be much nicer than cluttering up the ..._AutoGeneratingPropertyDefinition method.

    As I just converted a custom property [displayed in the property grid] from the SL30PropertyGrid to telerik, I thought it would be helpful to share some of my notes with others.

    1. If you want to update the source object [that the property grid has as its .Item property], your custom control must implement the INotifyPropertyChanged Interface.
    2. In your custom control, you should look at the bound data in your custom control's load event or the changed property that may have been set in the DependencyProperty.Register call. For example, if you try to set a text box in the property {set} you will be sorely disappointed that it is  NOT updating. For me, it I registered the property as public static readonly DependencyProperty ExtendedXPathProperty = DependencyProperty.Register("ExtendedXPath", typeof(string), typeof(SPListItemExtendedXPathEditor), new System.Windows.PropertyMetadata(ExtendedXPath_Changed));. Notice "ExtendedXPath_Changed". Although, you may simply be ok with looking at the control's load event if you never expect the property to change...except through the property grid...while browsing the property.


    My data template looks like the following. Note that I found it useful to also include a TextBox in a stackpanel for debug purposes. You may also find it helpful. Please note that I don't think I fully understand how to do the format painter so ignore and <br> tags as they aren't valid.

    <TextBox Text="{Binding ExtendedXPath, Mode=TwoWay}"
    ExtendedXPath="{Binding ExtendedXPath, Mode=TwoWay}" SourceURI="{Binding
    SourceURI, Mode=TwoWay}"
  8. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Sep 2012

    Posted 04 Sep 2012 Link to this post

    Has there been any updates to this?
    Can we decorate our business objects to define our custom editor now?
  9. Maya
    Maya avatar
    4062 posts

    Posted 06 Sep 2012 Link to this post

    Hi Jeremy,

    We have added similar feature request in our Public Issue Tracking System. I would encourage you to vote for it so that is rating gets higher, consequently its priority. 

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft R3 2016 release webinar banner