private void dataGridView1_CellClickobject sender DataGridViewCellEventArgs e if eColumnIndex == 11 dataGridView1Columns11ReadOnly = false;
要实现双击列后可以编辑值的效果,可以使用以下代码:
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 11) { dataGridView1.Columns[11].ReadOnly = false; this.dataGridView1.BeginEdit(true); } }
原文地址: https://www.cveoy.top/t/topic/iGSn 著作权归作者所有。请勿转载和采集!