mm马上给分!DataGridView定位到某一行!

ivanangel8818 2007-03-19 10:40:16
马上给分,我在DataTable添加一新行,DataGridView如何马上定位到当前添加的新行上!
...全文
934 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wxlcc520 2007-03-19
  • 打赏
  • 举报
回复
DataGridView.CurrentCell = DataGridView.Rows[你要的行索引].Cells[0];
guojh021 2007-03-19
  • 打赏
  • 举报
回复
DataGridViewCell cell = this.dataGridView1[0,1];
this.dataGridView1.CurrentCell = cell;

定位到第二行
不过要事前判断行数,不然出错
leixueqiyi 2007-03-19
  • 打赏
  • 举报
回复
// 把选中的行移动到用户新增的那行(最后一笔)
DataGridView.CurrentCell = DataGridView.Rows[this.DataGridView.Rows.Count - 1].Cells[0];

110,536

社区成员

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

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

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