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

Property definitions on subset of a varying class' properties

3 Answers 85 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 12 Nov 2012, 12:09 PM
Hi
I would like to use a single property grid to present a class that is selectable by a user. Also, I want to control what properties are presented for each class. To be more specific, I have currently five tables in SQL Server that are mapped using OpenAccessORM. In the future the number of tables may increase so I would only want to update the entity model component. I want the user to be able to select which table they want to view in the propertygrid and I also want to limit the columns of each table that are presented in the propertygrid.

With regards to the subset of properties, is there a way to use AutogeneratePropertyDefinitions="True" for a subset of columns? If not, would I have to add the property definitions I want to present in code rather than XAML?

To be able to use a single property grid, would I need to use DynamicObject?

I'm using RadControls Q3 (2012.03.1017) and OpenaccessORM Q3 (2012.03.1012).

Regards
Craig

3 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 15 Nov 2012, 01:43 PM
Hello,

Basically the AutogeneratePropertyDefinitions="True" setting would generated PropertyDefinitions for all properties. However, you can either cancel them in the event handler method or set Browsable=false attribute to those properties that are not needed to display. As for the other inquiry of yours, you don't actually need to use a single type to represent all the tables. You can use one RadPropertyGrid and change its item when switching between the tables. You are free to assign items of different types.

Greetings,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Craig
Top achievements
Rank 1
answered on 15 Nov 2012, 02:42 PM
Hi Ivan,
I've changed the item associated with the property grid at run time and that works well.

Regarding the Browsable attribute, I'm not sure how I can use it where the item is a class generated by OpenAccess ORM.

Also, I'd like to understand more about the available attributes but I can't find reference to them in the documentation. 

Where can I find out more about them?
0
Ivan Ivanov
Telerik team
answered on 19 Nov 2012, 12:09 PM
Hello Craig,

You may try using a Metadata class to define attributes for your properties. As for an attributes list, here is an example that demonstrates them PropertyGrid > DataAnnotationsSupport.

Regards,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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