如何捕获datagrid中的删除行事件处理程序? [英] How to capture the delete row event handler in the datagrid?

查看:47
本文介绍了如何捕获datagrid中的删除行事件处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



您好,


我有一个基本的简单问题。当我在

数据网格中有多条记录时如下:


代码产品1产品2产品3

11111 ABC

22222 DEF

33333 GHI

44444 JKL

当用户选择包含以下内容的第三行时我想要

值:33333,G,H和我按下键盘上的Delete键弹出一个

提示信息说:你确定要删除记录#

3333?如果用户选择YES,则删除该行。我知道如何

做剩下的我不知道该怎么办就是捕获并捕获删除

键,当该行被选中以提示该消息时。任何人都可以帮我吗

拜托?提前致谢。


Hello,

I have one basic simple question. When I have multiple records in the
datagrid as follows:

Code Product 1 Product 2 Product 3
11111 A B C
22222 D E F
33333 G H I
44444 J K L
I want when the user select the third row which holds the following
value: 33333, G, H, and I and presses the Delete key in the keyboard a
prompt message pops up saying: Are you sure you wish to delete record #
3333? If the user selects YES then it deletes that row. I know how to
do the rest what I don''t know how to do is catch and trap the delete
key when that row is select to prompt that message. Can anyone help me
please? Thanks in advance.

推荐答案

你好 am******@gmail.com
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q589q
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q587q

---

WBR,

Michael Nemtsev [C#MVP] ::博客: http://spaces.live.com/laflour


对我们大多数人来说,最大的危险是并不是说我们的目标太高而且我们错过了它,但它太低了,我们就达不到它了。 (c)米开朗基罗
Hello am******@gmail.com,

http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q589q
http://www.syncfusion.com/FAQ/aspnet/WEB_c4c.aspx#q587q
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

你好,


我有一个基本的简单问题。当我在

数据网格中有多条记录时如下:


代码产品1产品2产品3

11111 ABC

22222 DEF

33333 GHI

44444 JKL

当用户选择包含以下内容的第三行时我想要

值:33333,G,H和我按下键盘上的Delete键弹出一个

提示信息说:你确定要删除记录吗? />
#3333?如果用户选择YES,则删除该行。我知道

如何做其余的我不知道该怎么办就是当选择该行来提示该消息时捕获并捕获

删除键。任何人都可以帮助我吗?在此先感谢。
Hello,

I have one basic simple question. When I have multiple records in the
datagrid as follows:

Code Product 1 Product 2 Product 3
11111 A B C
22222 D E F
33333 G H I
44444 J K L
I want when the user select the third row which holds the following
value: 33333, G, H, and I and presses the Delete key in the keyboard a
prompt message pops up saying: Are you sure you wish to delete record
# 3333? If the user selects YES then it deletes that row. I know how
to do the rest what I don''t know how to do is catch and trap the
delete key when that row is select to prompt that message. Can anyone
help me please? Thanks in advance.



我很抱歉他们根本没有帮助我。根据这两个提示,我想要使我自己的子程序中有删除

代码,然后创建一个删除行的按钮。当我突出显示一行并按下键盘上的

删除按钮时,我想要的是一个处理程序。我知道怎么做另一个很容易

然而我不知道怎么做...这就是我需要它的原因。我们有一个

发货程序,有时候会有一个空行的完整行,

这会导致这个程序因空值错误而暂停,我们

自然希望删除该行并上传

服务器中的库存,但为了做到这一点,我们必须先点击按钮保存

然后再上传那。我们希望跳过这个过程,当我们删除那一行(空值)时它会自动保存它以便

我们只需点击一个名为upload的按钮而不是保存按钮

那么上传按钮。当用户

突出显示该行并按下删除按钮时,如何捕获事件处理程序?我一直在那个

网站上,他们在我的问题上帮助我失败了。可以

这里有人帮我吗?在此先感谢。


1月11日上午11点20分,Michael Nemtsev< nemt ... @ msn.comwrote:
I am sorry they did not help me at all. According to these two tips I
am suppose to make make my very own subroutine that have the delete
code in it then make a button where it will delete the rows...what I
want is a handler to fire when I highlight a single row and push the
delete button in the keyboard. I know how to do the other one easily
however I don''t know how to do this...here is why I need it. We have a
shipping program that sometimes have a complete row with null value,
this causes this program to halt with an error of a null value, we
naturally want to delete that row and upload the inventory in the
server, however in order to do that we must first click the button save
before we upload that. We want to skip that process in such away that
when we delete that row (null values) it automatically saves it so that
we just click one button which is called upload instead of SAVE button
THEN Upload button. How to catch an event handler when the user
highlights that row and pushes the delete button? I have been in that
website and they failed miserably in assisting me in my problem. Can
anyone here help me please? Thanks in advance.

On Jan 11, 11:20 am, Michael Nemtsev <nemt...@msn.comwrote:

你好amiga ... @ gmail.com,

http://www.syncfusion.com/FAQ/aspnet...c4c.aspx#q587q


---

WBR,

Michael Nemtsev [C#MVP] ::博客: http://spaces.live.com/laflour


" ;对我们大多数人来说,最大的危险并不是我们的目标太高而且我们错过了它,但它太低了,我们就达不到它了。 (c)米开朗基罗
Hello amiga...@gmail.com,

http://www.syncfusion.com/FAQ/aspnet...c4c.aspx#q587q

---
WBR,
Michael Nemtsev [C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

你好,
Hello,


我有一个基本的简单问题。当我在

数据网格中有多条记录时,如下所示:
I have one basic simple question. When I have multiple records in the
datagrid as follows:


代码产品1产品2产品3

11111 ABC

22222 DEF

33333 GHI

44444 JKL

我想要用户选择保存以下

值的第三行:33333,G,H和我按下键盘上的Delete键弹出一个

提示信息说:你是确定你想删除记录

#3333?如果用户选择YES,则删除该行。我知道

如何做其余的我不知道该怎么办就是当选择该行来提示该消息时捕获并捕获

删除键。任何人都可以帮助我吗?提前致谢。
Code Product 1 Product 2 Product 3
11111 A B C
22222 D E F
33333 G H I
44444 J K L
I want when the user select the third row which holds the following
value: 33333, G, H, and I and presses the Delete key in the keyboard a
prompt message pops up saying: Are you sure you wish to delete record
# 3333? If the user selects YES then it deletes that row. I know how
to do the rest what I don''t know how to do is catch and trap the
delete key when that row is select to prompt that message. Can anyone
help me please? Thanks in advance.


感谢您的帮助,但我解决了问题,对于那里的人

谁失败了或这就是答案:


Private Sub DATAGRIDNAMEHERE_PreviewKeyDown(ByVal sender As Object,

ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs)手柄

dgRATemp.PreviewKeyDown

如果e.KeyCode = Keys.Delete那么

.....

结束如果

结束子

Thank you for the help but I solved the problem, for people out there
who have failed or stuck in the same predicament this is the answer:

Private Sub DATAGRIDNAMEHERE_PreviewKeyDown(ByVal sender As Object,
ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles
dgRATemp.PreviewKeyDown
If e.KeyCode = Keys.Delete Then
.....
End If
End Sub


这篇关于如何捕获datagrid中的删除行事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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