![](/img/trans.png)
[英]Dynamically Adding ComboBox/Text Box to DataGridView Windows Forms C#
[英]focus in a cell value of DataGridView C# windows forms on adding a row
我有一个DataGridView
。 当我单击一个按钮时,一行被添加到DataGridView
。 有3列名为'Rate','Qty'和'Total'。 在添加行时,默认选择完整行。 我如何默认关注'Qty'列,以便我不需要在那里移动鼠标来编辑单元格值?
您可以使用以下内容:
DataGridView1.CurrentCell = DataGridView1.Rows[rowindex].Cells[columnindex]
要么
DataGridView1.CurrentCell = DataGridView1.Item("ColumnName", 1)
你可以直接关注编辑:
dataGridView1.BeginEdit(true)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.