如何使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