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

Binding to DataTable

3 Answers 151 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
GIAnet
Top achievements
Rank 1
Iron
GIAnet asked on 28 Nov 2011, 11:39 AM
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

3 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 01 Dec 2011, 10:06 AM
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.

0
GIAnet
Top achievements
Rank 1
Iron
answered on 01 Dec 2011, 10:38 AM
Hello,

thank´s a lot. It works. 

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

Greetings,
Frank
0
Ivan Petrov
Telerik team
answered on 05 Dec 2011, 01:50 PM
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.

Tags
PropertyGrid
Asked by
GIAnet
Top achievements
Rank 1
Iron
Answers by
Ivan Petrov
Telerik team
GIAnet
Top achievements
Rank 1
Iron
Share this question
or