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

PropertyGrid for a List Property

6 Answers 249 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Wenhao
Top achievements
Rank 1
Wenhao asked on 08 Mar 2012, 11:15 AM
Hi,
I am now using this RadPropertyGrid control for my current project, and it's a really fantastic tool that makes some of my jobs relieved. But I have got stuck now, as we have a model class show as follow:

I will need the properties in the nested ModelItem class to be displayed, just like Name..., but what i got is some properties of the type List<T>, that's not I expected.

I wan wondering how could I got the properties of items in an array or a list, just like RadTreeListView? Or is there a special workaround?
public class Model{<BR>public List<ModelItem>
List{get;set;}<BR>}<BR>public class ModelItem<BR>{<BR>public string
Name{get;set;}<BR>}<BR>

6 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 08 Mar 2012, 12:42 PM
Hello Wenhao,

Thank you for your kind words and valuable feedback. RadPropertyGrid does not provide a default editor for collection type properties yet. However, we have planned to introduce a native collection editor control for RadPropertyGrid with our next Q release. The current recommended approach is to use custom editor template for the field that is bound to the collection property. Please, let us know if you have met any obstacles while implementing this.

Kind regards,
Ivan Ivanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Wenhao
Top achievements
Rank 1
answered on 08 Mar 2012, 04:30 PM
Hi Ivan,

Thanks for this timely reply and your kind suggestions. However, as we discussed previously, we would prefer the List<T> field to be displayed like a nested property of the host type, I mean how could we do custom the label column via implementing a custom editor template. Sorry but I am still confused on this. Could you help deliver a brief demo or some code sample?

Your time and effort on this are really appreciated.

Regards,
Wenhao
0
Ivan Ivanov
Telerik team
answered on 09 Mar 2012, 11:14 AM
Hello Wenhao,

Unfortunately RadPropertyGrid's nested properties feature purpose is a bit different. It is designed to display and process hierarchies of CLR types, not collections of items, so that currently there is no clean approach to accomplishing this task. However, we are going to introduce a minor change in RadPropertyGrid's NestedProperties binding logic with Q1's service pack, of which your scenario would benefit. Would you please confirm whether it is an option for you to wait for several days for our SP release? If so, I will contact you, as soon as it is available for our clients, providing you and example illustrating how to achieve this.

Kind regards,
Ivan Ivanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Wenhao
Top achievements
Rank 1
answered on 09 Mar 2012, 05:38 PM
Hi Ivan,

Thank you for your detailed update on this thread. It would be a little bit regretful that PropertyGrid does not introduce a built-in approach currently. As for now, we generate an IL type dynamically at runtime via reflection to accomplish temporarily, whereas runtime performance and stability are also important. We are still looking forward to the next service pack of Q1 to make it smoothly.

Thank you for your time on this.

Regards,
Wenhao
0
Ivan Ivanov
Telerik team
answered on 12 Mar 2012, 09:53 AM
Hello Wenhao,

Please, let me thank you for your patience. I will keep in touch with you, in order to contact you as soon as the SP is released. I will do my best to prepare a demo project for you by then.

Kind regards,
Ivan Ivanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ivan Ivanov
Telerik team
answered on 15 Jun 2012, 08:45 AM
Hello,

With the recently released Q2 version of RadControls, RadPropertyGrid can edit IEnumerable type-compatible properties utilizing the new CollectionEditor control.

Regards,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
PropertyGrid
Asked by
Wenhao
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Wenhao
Top achievements
Rank 1
Share this question
or