如何移动光标到datagridview的下一行 [英] How to move cursor to the next row in datagridview
本文介绍了如何移动光标到datagridview的下一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含2 datagridviews和它们之间的按钮将数据传送Windows窗体。我想不出我应该如何移动选定行的光标移到下一行后,该按钮已成功地传输数据。
解决方案
如果(dataGridView1.CurrentRow!= NULL)
dataGridView1.CurrentCell =
dataGridView1的
.Rows [Math.Min(dataGridView1.CurrentRow.Index + 1,dataGridView1.Rows.Count - 1)]
.Cells [dataGridView1.CurrentCell.ColumnIndex]
I have a Windows Form that contains 2 datagridviews and a button between them to transfer the data. I cannot figure out how should i move the cursor of selected row to the next row after the button has successfully transfer the data.
解决方案
if (dataGridView1.CurrentRow != null)
dataGridView1.CurrentCell =
dataGridView1
.Rows[Math.Min(dataGridView1.CurrentRow.Index + 1, dataGridView1.Rows.Count - 1)]
.Cells[dataGridView1.CurrentCell.ColumnIndex];
这篇关于如何移动光标到datagridview的下一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文