Can you bind Property Grid to a data source?

3 posts, 0 answers
  1. Jay
    Jay avatar
    11 posts
    Member since:
    Mar 2012

    Posted 02 May 2012 Link to this post

    I was wondering if you can bind the property grid to a dat source like SQL table or microsoft access table?
    If so can you show me an example. I have an access table with 6 columns and about 100 rows. I know a gridview is what i shoudl use but i want to use a property grid view.
    ID - uniqueID
    ParentID - correlates to which ID to group with
    Order - order of group
    Decs - description of what it is screen display
    Type - type
    Value - value
    ID   ParentID   Order      Desc   Type  value
    1        0              0           Gen    CAT
    2        1              0           help    bool    true               
    3        1              1           num    int       7
    4        0              1           Dogs   CAT
    5        4              0           Labs    int      2
    6        5              0           Yellow  int      1
    7        5              1           Black   int      1

    so the property grid would look like this.
        Help             true
        num              7
       -Labs            2
           Yellow       1
            Black       1
    would this even be possible?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 May 2012 Link to this post

    Hi Jay, 

    You can bind the Property Grid to a an object, multiple object or add custom properties via a Property Store. Have a look at the documentation here

    Hope this helps, but feel free to ask any other questions if you have them
  3. DevCraft R3 2016 release webinar banner
  4. Ivan Petrov
    Ivan Petrov avatar
    701 posts

    Posted 07 May 2012 Link to this post

    Hello Jay and Richard,

    Thank you for writing.

    Please, refer to the attached sample project for a sample implementation of a similar case. To achieve your scenario you have to fill the data in a data table and via a custom type and property descriptors to show it into a RadPropertyGrid. There are two limitations, however:
    -  you cannot group on more than one level
    -  you cannot nest properties inside each other

    I hope this will be useful for you. Should you have further questions, I would be glad to help.
    Kind regards,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top