禁用默认的数据网格操作 [英] Disable a default data grid action

查看:88
本文介绍了禁用默认的数据网格操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vb .net中开发了一个表单,该表单具有显示字段的数据网格
客户编号,名称,位置

当用户在任何客户上按Enter键时,它将提取该选定行的客户ID,并以新形式显示该客户的账单.

在这里,当我们在特定行上按Enter键时,窗口将打开,显示特定客户的所有详细信息,但以主要形式选择了下一行.

它是数据网格的默认属性,当我们在一行上按Enter时,它将选择下一行.

I have a form develop in vb .net having a data grid showing fields
customerid, name, location

when user press enter on any customer then it will extract the customerid for that selected row and will show the bills of that customer in new form.

Here when we press enter on a particular row then the window gets open showing all the details of the particular customer but in main form the next row is selected.

Its a default property of data grid tht when we press enter on a row then it will select next row. Can any one tell how to disable the default enter event.

推荐答案

处理KeyUp事件,并使用KeyPressEventArgs.Handled = true
Handle the KeyUp event and cancel it with KeyPressEventArgs.Handled = true


取消它.


这篇关于禁用默认的数据网格操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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