如何使datagridview中的列可编辑 [英] How to make a column in datagridview editable
本文介绍了如何使datagridview中的列可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我在datagridview中有两列.第一列以数据表为界,第二列为空.列的定义是这样的:
Dear all,
I have two columns in datagridview. The first column is bounded from the datatable and the second column is empty. The definition of the columns are like this:
DataGridViewTextBoxColumn textColumn = new DataGridViewTextBoxColumn();
textColumn.DataPropertyName = "column1";
textColumn.Name = "column1";
textColumn.ReadOnly = true;
dataGrid.Columns.Add(textColumn);
textColumn = new DataGridViewTextBoxColumn();
textColumn.Name = "column2";
dataGrid.Columns.Add(textColumn);
如何使column2始终处于编辑模式?
预先感谢.
How can I make column2 always in edit mode?
Thanks in advance.
推荐答案
亲爱的Salah_Afa,
将第二列的ReadOnly选项设置为FALSE.因此,它将使第二列可编辑.
希望以上解决方案能帮助您解决.
谢谢
Dear Salah_Afa,
Do the ReadOnly option of second column as FALSE. It will hence make the second column editable.
Hope the above solution helps yot out.
Thanks
1.首先使用BoundColumns
2.将您的可编辑内容设置为ReadOnly = false
1.First of all Use BoundColumns
2.Make your editable as column ReadOnly=false
这篇关于如何使datagridview中的列可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文