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

ReadOnly DON'T WORK

1 Answer 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
accdefault
Top achievements
Rank 1
accdefault asked on 21 Mar 2020, 03:08 PM

 

 

                _dr = parent.data.view.sys.village_request_res.Select("id_village = '" + village["id"].ToString() + "' ");
                if (_dr.Length > 0)
                {
                    dgVillageRequestRes.DataSource = _dr.CopyToDataTable();
                    dgVillageRequestRes.Columns["id_village"].IsVisible = false;
                    dgVillageRequestRes.Columns["name"].IsVisible = false;
                    dgVillageRequestRes.Columns["priority"].ReadOnly = false; //DON'T WORK
                }
                else { dgVillageOper.DataSource = null; }

 

I cannot edit cells in the Columns["priority"] column. Help fix!

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 23 Mar 2020, 12:50 PM

Hello,

Note that such a query will return a list of anonymous objects. These objects in the data table are read-only and this is why you can not edit them in the grid. You should change the value in the data source manually, execute the query again and rebind the grid.

Please refer to the following msdn threads that might be quite useful on this topic:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/3f6e51c6-fe3f-48b2-88b7-835663fd31fb/datagridview-column-cant-be-changed-from-readonly-to-writable?forum=vbgeneral
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d5527c78-9c97-4535-865f-07b50f68a888/how-to-make-datagridview-editable-when-binding-with-linq?forum=csharpgeneral

I hope this information helps. Should you have other questions I will be glad to help.

Regards,
Nadya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
accdefault
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or