Support for enum Intellisense and complex types?

4 posts, 1 answers
  1. Erik
    Erik avatar
    43 posts
    Member since:
    Jan 2011

    Posted 23 Oct 2014 Link to this post

    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
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 Oct 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Erik
    Erik avatar
    43 posts
    Member since:
    Jan 2011

    Posted 28 Oct 2014 in reply to Dimitrina Link to this post

    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.
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 29 Oct 2014 Link to this post

    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.

     
Back to Top