如何双击非编辑单元格并进行编辑模式(简单)? [英] How Do I Double-click on non-edit cell and make edit mode (simply)?

查看:53
本文介绍了如何双击非编辑单元格并进行编辑模式(简单)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

必须缺少双击DataGridViewCell的简单方法,并且能够在编辑模式下获取它,这样您就可以输入单元格并更改值。

这里是我的项目代码,如果你需要完整的源代码(Form1.cs,第4533行)和DataGridView在设置选项卡上。

我已经阅读了一些东西,但我想避免尽可能多的事件处理程序可能。

https://dl.dropboxusercontent.com/u/60712778/MCMyVault。 zip [ ^ ]



There must be missing an easy way to double-click on a DataGridViewCell and be able to get it in edit mode so you can type into the cell and change the value.
here is my project code if you need the full source (Form1.cs, line 4533) and the DataGridView is on the "Settings" tab .
I have read some things but I would like to avoid as many event handlers as possible.
https://dl.dropboxusercontent.com/u/60712778/MCMyVault.zip[^]

DataGridViewCell cell = dataGridViewSettings.Rows[e.RowIndex].Cells[e.ColumnIndex + 1];
cell.InitializeEditingControl(e.RowIndex, dataGridViewSettings.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value, dataGridViewSettings.Rows[e.RowIndex].DefaultCellStyle);

//   dataGridViewSettings.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].InitializeEditingControl(e.RowIndex, dataGridViewSettings.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value, dataGridViewSettings.Rows[e.RowIndex].DefaultCellStyle);
//   dataGridViewSettings.EditMode = DataGridViewEditMode.EditOnEnter;

dataGridViewSettings.EditMode = DataGridViewEditMode.EditOnEnter;
dataGridViewSettings.ReadOnly = false;

推荐答案

这篇关于如何双击非编辑单元格并进行编辑模式(简单)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆