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

Custom property editors

7 Answers 174 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 13 Jul 2011, 02:50 AM
So glad to see you guys working on this new control!! 

We are currently using the project at http://slg40.codeplex.com/ 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!
Thanks

7 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 14 Jul 2011, 03:32 PM
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!

0
Louis
Top achievements
Rank 1
answered on 19 Jul 2011, 02:25 AM
Thanks, I'll take a look.
0
Charles Willwerth
Top achievements
Rank 1
answered on 11 Nov 2011, 07:21 AM
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.
0
Ivan Ivanov
Telerik team
answered on 11 Nov 2011, 03:50 PM
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 >>
0
Jason
Top achievements
Rank 1
answered on 16 Nov 2011, 07:17 AM

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.

<DataTemplate
x:Key="SPListItemExtendedXPathEditorTemplate">              
<StackPanel
Orientation="Vertical">               
<!--    
<TextBox Text="{Binding ExtendedXPath, Mode=TwoWay}"
/>                  
-->                   
<blueclarityPropertyBrowserSPListItem:SPListItemExtendedXPathEditor
ExtendedXPath="{Binding ExtendedXPath, Mode=TwoWay}" SourceURI="{Binding
SourceURI, Mode=TwoWay}"
/>               
</StackPanel>
</DataTemplate>
0
Jeremy
Top achievements
Rank 1
answered on 04 Sep 2012, 09:31 PM
Has there been any updates to this?
Can we decorate our business objects to define our custom editor now?
0
Maya
Telerik team
answered on 06 Sep 2012, 07:42 AM
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,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PropertyGrid
Asked by
Louis
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Louis
Top achievements
Rank 1
Charles Willwerth
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Jason
Top achievements
Rank 1
Jeremy
Top achievements
Rank 1
Maya
Telerik team
Share this question
or