Keyup, KeyDown, and KeyPress events for a datagrid do not work. URGENT !!!!

C

Chris Calhoun

Here are the three event handlers I am trying to catch the key events, but
they do not work.
private void dgResults_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e) {
MessageBox.Show("Key Down!");
}
private void dgResults_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) {
MessageBox.Show("Key Pressed!");
}
private void dgResults_KeyUp(object sender,
System.Windows.Forms.KeyEventArgs e) {
MessageBox.Show("Key Up!");
}
 
J

Jim Cheshire [MSFT]

Chris,

In an HTTP application, you are in a stateless environment. Therefore,
when the user of your application hits a key on their keyboard, there is no
way for the application running on the Web server to know this.

If you want to capture keyboard events, you will need to write client-side
code.

Jim Cheshire [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top