[英]How can I make the DataGridView select and focus on the last row I added to it?
dataGridView1.Rows.Add(txtItemId.Text, txtItemName.Text,txtQuantity.Text, txtPrice.Text);
The above code adds a new row with the values I entered in textboxes, but the DataGridView
keeps selecting the first row even if it contains more than one row. 上面的代码用我在文本框中输入的值添加了新行,但是
DataGridView
仍然选择第一行,即使它包含多个行也是如此。 What I want is to make DataGridView
select the last row I already added. 我想要使
DataGridView
选择我已经添加的最后一行。 How can I do this? 我怎样才能做到这一点?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.