Binding to DataTable

4 posts, 0 answers
  1. GIA
    GIA avatar
    7 posts
    Member since:
    Mar 2009

    Posted 28 Nov 2011 Link to this post

    Hello,
    I would like to bind the PropertyGrid to a datatable which has only 1 Column.
    I want to use the PropertyGrid as a detail form for editing a Datatable with 1 column (like Parameters etc.).

    Is this possible or do I have to convert to an object by code.


    thanks for an answer.

    Frank

  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    691 posts
    Member since:
    Sep 2012

    Posted 01 Dec 2011 Link to this post

    Hello Frank,

    Thank you for writing.

    The RadPropertyGrid displays couples of property name and property value. You will need to provide at least these two parameters to be able to work with the RadPropertyGrid. Please find attached an example project which shows how to bind the RadPropertyGrid to a DataTable using custom type descriptor.

    I hope this will help. Should you need further assistance, I would be glad to help.

    Greetings,
    Ivan Petrov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  3. GIA
    GIA avatar
    7 posts
    Member since:
    Mar 2009

    Posted 01 Dec 2011 Link to this post

    Hello,

    thank´s a lot. It works. 

    But I also need the description for each column. How can I achieve this?

    Greetings,
    Frank

  4. Ivan Petrov
    Admin
    Ivan Petrov avatar
    691 posts
    Member since:
    Sep 2012

    Posted 05 Dec 2011 Link to this post

    Hi Frank,

    Thank you for your reply.

    To add a description in the property grid you can add a third column in the data table with the description text. You can then add a Description attribute with the text from that column in the constructor of the custom property descriptor in this example named "MyPropertyDescriptor". I have made these changes in the example and I have added a comment which starts with "//DESCRIPTION" in the places I have made changes. There are a total of three modifications that you can quickly navigate to by searching for the above comment start.

    If you have further questions, feel free to write back.

    Greetings,
    Ivan Petrov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Back to Top