Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > PropertyGrid > Binding to DataTable

Not answered Binding to DataTable

Feed from this thread
  • GIA avatar

    Posted on Nov 28, 2011 (permalink)

    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

    Reply

  • Ivan Petrov Ivan Petrov admin's avatar

    Posted on Dec 1, 2011 (permalink)

    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.

    Reply

  • GIA avatar

    Posted on Dec 1, 2011 (permalink)

    Hello,

    thank´s a lot. It works. 

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

    Greetings,
    Frank

    Reply

  • Ivan Petrov Ivan Petrov admin's avatar

    Posted on Dec 5, 2011 (permalink)

    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > PropertyGrid > Binding to DataTable