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

Support for enum Intellisense and complex types?

3 Answers 22 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 2
Erik asked on 23 Oct 2014, 11:52 AM
Hi - I'm hoping to use the combo of the RadPropertyGrid with the Dynamic Linq library and generic types as a way to support business rules.  I've already got fully working code with a TextBox and now am hoping to replace that with a  more feature-rich ExpressionEditor.

The idea is this: given an arbitrary class (well known at runtime), create an object of the class and wire it up to the RadPropertyGrid as a "sample".  Then use the RadExpressionEditor (also wired to the same object) to enable the user to craft an expression that can select that item later during some other business processing (again, I have this basically working).

My three questions are as follows:
* the RadPropertyGrid supports DataAnnotations for things like [Browsable(false)] to suppress a given property from the RadPropertyGrid.  I'm wondering if the same DataAnnotation support could be added to the ExpressionEditor Fields list so that fields like "IsChanged" (just part of the IChangeTracking interface) could be suppressed.
* Can the Fields list of the ExpressionEditor be updated to support complex types like the Property Grid (like nested properties)?  (e.g. Class a has three string properties and a fourth property of "ClassB" with three int properties -- I want to see the deep property names for the three ints in the field list).
* Can the Editor itself support intellisense for an enum type?  (e.g. property X if of type Choices which is an enum -- so then I add "X = " using the Expression Editor functions and manually start typing "Choices." in the editor and can see the possible values.

I'm guessing the information I've provided above is enough to answer, but if you would like some code snippets and/or screenshots of this, I can provide those.

Thanks in advance for your consideration.  (and congrats on the Progress thing :)  )

Erik Dahl
‚Äč

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 28 Oct 2014, 09:12 AM
Hi Erik,

Thank you for the nice words.

As to your specific question on the RadExpressionEditor control, you can find my answers below:
1. This is possible. You need to use the Display DataAnnotations attribute with AutoGenerateField = false on every property of the class that you wish to hide.
2. I am afraid no. The Fields list of the ExpressionEditor cannot be updated.
3. I am afraid no. Currently IntelliSense is not supported in RadExpressionEditor and we do not have immediate plans to introduce such.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Erik
Top achievements
Rank 2
answered on 28 Oct 2014, 07:09 PM
Thanks for the answers.  I noticed that when I used the DisplayName attribute, that was honored by the ExpressionEditor, and noticed also that in fact the Browsable(false) attribute is also.  So I was able to get what I wanted in the same way for both the PropertyGrid and Expression Editor.  Swell!

As for the deep properties and enum support, that's cool.  I'll be able to work around those with the team.  Thanks again for your response.
0
Dimitrina
Telerik team
answered on 29 Oct 2014, 07:22 AM
Hello,

Thank you for sharing your feedback.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ExpressionEditor
Asked by
Erik
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Erik
Top achievements
Rank 2
Share this question
or