开发者

Using linq select to provide a grid datasource, properties are read-only

I am using the return from the following call as the datasource for a grid. public object GetPropertyDataSourceWithCheckBox( ) 开发者_开发技巧 { return ( from p in LocalProperties join c in GetCities( ) on p.CityID equals c.CityID orderby p.StreetNumber select new { Selected = false, p.PropertyID, p.StreetNumber, p.StreetName, c.CityName } ).ToList( ); }

I get a checkbox in the grid, but it is READ-ONLY. [For the record, the grid is DevExpress.] Is there a way around this, short of creating a non-anonymous class?


Continuing research tells me that, in fact, anonymous classes returned by linq are always read-only, so, apparently, creating an actual class is best (only?) solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜