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

Posted by Kelly on Stack Overflow See other posts from Stack Overflow or by Kelly
Published on 2010-03-04T17:40:17Z Indexed on 2010/03/08 3:51 UTC
Read the original article Hit count: 251

Filed under:

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?

© Stack Overflow or respective owner

Related posts about c#3.0