Why does the grid become readonly? How to avoid readonly grid problem?

I have a DevExpress xtraGrid that I want to bind. When I try to bind, the compiler gives an error that the gridView data source is read-only. I tried the approach below my code

 NorthwindDataContext db = new NorthwindDataContext();
 var r = from p in db.Orders
         select p;
 var r2 = from p in db.Order_Details
         select p;

 gridView1.DataSource = r;
 gridView2.DataSource = r2;

I get the following error: Property or indexer "DevExpress.XtraGrid.Views.Base.BaseView.DataSource" cannot be assigned - it is read-only

I checked the column property on a gridView and not just readable. Why am I getting this error? My grid is actually empty, I'm going to bind it to the database.

+3
source share
2

DataSource GridControl, GridView, GridView.

DevExpress:

+6

XtraGrid . GridViews, ( , ..), GridControl LevelTree.

0

Source: https://habr.com/ru/post/1774530/


All Articles