如何在datagridview中移回前一个单元格 [英] How to move back on previous cell in datagridview
本文介绍了如何在datagridview中移回前一个单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有
我使用tab键在datagridview中移动下一个单元但是在检查条件后
if(gdv.Rows [gdv.CurrentRow.Index] .cells [3]。价值== )。我想回到之前的单元格。
请任何人让我知道如何实现它。
我的尝试:
this.gdv.CurrentCell = this.gdv.Rows [gdv.CurrentRow.Index] .Cells [2]
Dear All
I am using tab button to move next cell in datagridview but after checking a condition
if(gdv.Rows[gdv.CurrentRow.Index].cells[3].Value==""). I want to be back on previous cell.
please any one let me know how to achieve it.
What I have tried:
this.gdv.CurrentCell = this.gdv.Rows[gdv.CurrentRow.Index].Cells[2]
推荐答案
下面的代码可以帮助你实现你想要的......
DataGridView1 .CurrentCell = DataGridView1.Rows [rowindex] .Cells [columnindex]
或
DataGridView1.CurrentCell = DataGridView1.Item(ColumnName ,5)
您可以使用以下代码直接关注编辑:
dataGridView1.BeginEdit(true)
The below code should help you to achieve what you want..
DataGridView1.CurrentCell = DataGridView1.Rows[rowindex].Cells[columnindex]
or
DataGridView1.CurrentCell = DataGridView1.Item("ColumnName", 5)
and you can directly focus with Editing using below code:
dataGridView1.BeginEdit(true)
这篇关于如何在datagridview中移回前一个单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文