将焦点设置在vb.net的datagridview中的所选单元格中 [英] Set Focus in my selected cell in the datagridview in vb.net

查看:620
本文介绍了将焦点设置在vb.net的datagridview中的所选单元格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的datagridview中,我有4行所有行r editable。在选择datagrid中的最后一行然后我对数据网格进行排序然后选择下一行。但焦点是转到该行的1个单元格而不是选中一个。一个人帮我

解决方案

USe

 Datagridview1.Rows( 0 )。单元格( 0 )。Selected = True 
Datagridview1。选择()







这将选择First Row的First Cell。根据您的要求使用行号和单元号。


DataGridView1.CurrentCell = DataGridView1.Rows [index] .Cells [2];

DataGridView1.BeginEdit (真);

In my datagridview i have 4 rows all row r editable .after select the last row in the datagrid then i am sort the datagrid then select the next row .but the focus was go to the 1 cell of that row not the selected one .any one help me

解决方案

USe

Datagridview1.Rows(0).Cells(0).Selected = True
Datagridview1.Select()




This will select the First Row''s First Cell. Use the Row and Cell No. According to your requirement.


DataGridView1.CurrentCell = DataGridView1.Rows[index].Cells[2];
DataGridView1.BeginEdit(true);


这篇关于将焦点设置在vb.net的datagridview中的所选单元格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆