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

RadGrid ComboColumn LINQtoSQL Datasource

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
shoaib hussain
Top achievements
Rank 1
shoaib hussain asked on 06 Nov 2009, 07:38 PM
I am using the following code to set the datasource for combobox Column

((GridViewComboBoxColumn)radGridView1.Columns["Name"]).DataSource = from medicine in db.Medicines
                                                                                                                         select medicine;
 ((GridViewComboBoxColumn)radGridView1.Columns["Name"]).DisplayMember = "Name";
((GridViewComboBoxColumn)radGridView1.Columns["Name"]).ValueMember = "ID";

during adding new row in grid, when i click on combo column, following exception throws

but getting the following Exception

"The list must be an IBindingList to AddNew."

a quick response would be highly appreciated

thanks

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 12 Nov 2009, 12:37 AM
Hi Shoaib Hussain,

The winforms RadGridView support adding/removing operations for objects which is implement IList/IBindingList interfaces and work like standard DataGridView. In your scenario you are using LinqToObject and it produces an IEnumerable object that does not support this functionality. 

Greetings,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
shoaib hussain
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or