Visibility for PropertyDefinition?

6 posts, 0 answers
  1. AvgurD
    AvgurD avatar
    18 posts
    Member since:
    Oct 2012

    Posted 11 Nov 2011 Link to this post

    Hi!

    It's possible - add Visibility (with binding, ect) to PropertyDefinition?

    Best regards, Jah
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 15 Nov 2011 Link to this post

    Hello Jah,

    As PropertyDeifinitions are not visual elements and they are not meant to contain any information about the view, such a change would interfere with RadPropertyGrid's base logic. However, you may try binding the respective PropertyGridField's Visibility property or, as alternative approach, to remove and add PropertyDefinitions at runtime. Would you please share with us what exactly are you trying to achieve so that we could give you some guidelines adapted to your scenario?

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. AvgurD
    AvgurD avatar
    18 posts
    Member since:
    Oct 2012

    Posted 16 Nov 2011 Link to this post

    Hello, Ivan!

    In model i have one entity wich contains 2 similar objects types. One object type have value for property A, and null for property B, other - opposite. And I want for first type make invisible property row  B, for second -  A. It will be right in the sense for the user.
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 21 Nov 2011 Link to this post

    Hi Jah,

    You may try reading properties' values on  RadPropertyGrid's AutoGeneratingPropertyDefinition, using PropertyInfo.GetValue(Object, Object[]) and cancel their generation process. Would you please confirm whether such a solution is applicable in your scenario?

    Best wishes,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  6. kilhoffer
    kilhoffer avatar
    40 posts
    Member since:
    May 2007

    Posted 11 Mar 2013 Link to this post

    What about cases where property definitions are not auto-generated? The AutoGeneratingPropertyDefinition event does not fire in this case.
  7. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 14 Mar 2013 Link to this post

    Hello,

     PropertyDefinition already has a Visibility property. You can bind it to a property of your ViewModel in XAML.

    All the best,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner