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

uneditable GridView when using Linq as source

2 Answers 134 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert Stuczynski
Top achievements
Rank 1
Robert Stuczynski asked on 29 Jan 2010, 01:23 PM

I fill data in GridView using this Linq code:

 

 
var p = dbZ.ZleceniaLinies  
 
.Select(c => new  
 
{  
 
ID = c.idLinii,  
 
Typ = c.Typ  
 
});  
 
radDgvPozyc.DataSource = p;  
 


 

radDgvPozyc.DataSource = p;

It works very fine and I love Telerik GridView but. Line for adding new record is (I see it) on my form but I can't put data there. And I can't modify any cells because they not editable :(
I checked and RadGridView control is enabled and ReadOnly properties of the cell, column, and control are all set to false.

How set it do Add, Modify and Delete from this DataGrid?

2 Answers, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 02 Feb 2010, 10:15 AM
Hello Robert Stuczynski,

Winforms controls - RadGridView as well - do not support direct editing of a result of LINQ query. To work properly the returned IList from query must implement IListSource or IBindingList interfaces. More information and examples about this topic can be found here in MSDN.

Sincerely yours,
Julian Benkov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Robert Stuczynski
Top achievements
Rank 1
answered on 08 Feb 2010, 09:19 AM
I resolve it using DataSource:

radGridView1.DataSource = db.tabelaZlecenias.Where(c => c.idZlecenia > 3);

Tags
GridView
Asked by
Robert Stuczynski
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Robert Stuczynski
Top achievements
Rank 1
Share this question
or