When i bind my linq query to the datasource of the datagridview, i cannot change any of the cells values in the gridview. The columns readonly property is automatically set to true and when i tried to set it false it gives following exception:-
DataGridView column bound to a read-only field must have ReadOnly set to True. LINQ
This is my code for it
DataClasses1DataContext db = new DataClasses1DataContext();
var selectquery = from s in db.Sarees where s.Bill.BillNo == billno select new { s.BillID,s.Price };
I found 1 solution to this problem which is not filthy if there are many columns in the table and i want to select only two... The 1 solution is :-
var selectquery = db.Sarees.Where(s => s.Bill.BillNo == billno);
When i gave this query it works fine.. But i want a solution in which i can select only some columns by LINQ and can change its value when binded through a datagridview...