Property definitions on subset of a varying class' properties

4 posts, 0 answers
  1. Craig
    Craig avatar
    112 posts
    Member since:
    Nov 2011

    Posted 12 Nov 2012 Link to this post

    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

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 15 Nov 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Craig
    Craig avatar
    112 posts
    Member since:
    Nov 2011

    Posted 15 Nov 2012 Link to this post

    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?
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 19 Nov 2012 Link to this post

    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.

Back to Top