Datagridview的SelectionChanged事件中按tab键的问题

Imstar 2009-07-29 12:52:58
RT
按tab键移动选中单元格的时候,在SelectionChanged事件中取得的CurrentCell始终是当前单元格而不是目标单元格。
请问有什么好办法能解决?

...全文
100 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
laoban108 2009-07-31
  • 打赏
  • 举报
回复
学习
cszg_zjy 2009-07-29
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 dancingbit 的回复:]
使用CurrentCellChanged事件。
[/Quote]是啊 用这个事件比较好吧
journeydj 2009-07-29
  • 打赏
  • 举报
回复
因为Change了
dancingbit 2009-07-29
  • 打赏
  • 举报
回复
使用CurrentCellChanged事件。
gwf25sz 2009-07-29
  • 打赏
  • 举报
回复
在body里面 去判断键盘事件·········
wuyq11 2009-07-29
  • 打赏
  • 举报
回复
设置当前单元格
private void dataGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Tab)
{
int row = this.dataGridView1.CurrentCell.RowIndex;
int cel=this.dataGridView1.CurrentCell.ColumnIndex;
row = (row + 2) % this.dataGridView1.Rows.Count;
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[row].Cells[cel];

}
}

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧