简体   繁体   中英

C# datagridview editing control

I have an application that has a datagridview in it obviously enough, and I add data to it programatically like so:

    dataGridView1.Rows.Add(string[]);

Before I add any objects to the dataGridView I can edit the cells by double clicking, hitting enter or f2. After data has been added into the rows however, I can no longer edit any of the values. I have tried toggling the "Read Only" attribute from true to false, and also tried to mess with:

    dataGridview1.EditMode ....

I don't know how to make the edit mode work properly, but on all previous keystrokes it just highlights the next row in the list.

How can I enable the user to edit the data in the data grid view once the rows have been added ?

Here are a list of tutorials on ways to accomplish this here:

http://www.codeproject.com/Questions/433279/edit-delete-update-cancel-in-gridview-asp-net

I would start with these.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM