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

Visibility for PropertyDefinition?

5 Answers 194 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
AvgurD
Top achievements
Rank 1
AvgurD asked on 11 Nov 2011, 07:39 PM
Hi!

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

Best regards, Jah

5 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 15 Nov 2011, 04:18 PM
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 >>
0
AvgurD
Top achievements
Rank 1
answered on 16 Nov 2011, 06:44 PM
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.
0
Ivan Ivanov
Telerik team
answered on 21 Nov 2011, 03:40 PM
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 >>
0
kilhoffer
Top achievements
Rank 1
answered on 11 Mar 2013, 03:40 PM
What about cases where property definitions are not auto-generated? The AutoGeneratingPropertyDefinition event does not fire in this case.
0
Ivan Ivanov
Telerik team
answered on 14 Mar 2013, 04:02 PM
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.

Tags
PropertyGrid
Asked by
AvgurD
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
AvgurD
Top achievements
Rank 1
kilhoffer
Top achievements
Rank 1
Share this question
or