473,577 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

KeyPress Event not Firing???

Hi,

I am trying to catch the KeyPress event on my datagrid but it isn't
working... i have also tried registering the handler with the event like
this...

dgGLBatch.KeyPr ess += new KeyPressEventHa ndler(dgGLBatch _KeyPress);

but nothing changed. I was wondering wether a custom table and column style
might have an effect on how this works???
my code is below...

private void dgGLBatch_KeyPr ess(object sender,
System.Windows. Forms.KeyPressE ventArgs e) {

if(e.KeyChar == (char)13)

SendKeys.Send(" {TAB}") ;

}
Regards

Darryn
Nov 16 '05 #1
3 7352
You have to set the KeyPress event to the TextBox Column only, not to the Grid.

Regards,
Amal

"Darryn Ross" wrote:
Hi,

I am trying to catch the KeyPress event on my datagrid but it isn't
working... i have also tried registering the handler with the event like
this...

dgGLBatch.KeyPr ess += new KeyPressEventHa ndler(dgGLBatch _KeyPress);

but nothing changed. I was wondering wether a custom table and column style
might have an effect on how this works???
my code is below...

private void dgGLBatch_KeyPr ess(object sender,
System.Windows. Forms.KeyPressE ventArgs e) {

if(e.KeyChar == (char)13)

SendKeys.Send(" {TAB}") ;

}
Regards

Darryn

Nov 16 '05 #2
And how do you do that when there is no KeyPress event under
DataGridTextBox Column?
"AMALORPAVANATH AN YAGULASAMY (AMAL)"
<AM************ *************** *@discussions.m icrosoft.com> wrote in message
news:14******** *************** ***********@mic rosoft.com...
You have to set the KeyPress event to the TextBox Column only, not to the Grid.
Regards,
Amal

"Darryn Ross" wrote:
Hi,

I am trying to catch the KeyPress event on my datagrid but it isn't
working... i have also tried registering the handler with the event like
this...

dgGLBatch.KeyPr ess += new KeyPressEventHa ndler(dgGLBatch _KeyPress);

but nothing changed. I was wondering wether a custom table and column style might have an effect on how this works???
my code is below...

private void dgGLBatch_KeyPr ess(object sender,
System.Windows. Forms.KeyPressE ventArgs e) {

if(e.KeyChar == (char)13)

SendKeys.Send(" {TAB}") ;

}
Regards

Darryn

Nov 16 '05 #3
try DataGridTextBox Column.TextBox. KeyPress.

=============== ==
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools

"Darryn Ross" <da****@datawav e.com.au> wrote in message
news:uz******** ******@TK2MSFTN GP12.phx.gbl...
And how do you do that when there is no KeyPress event under
DataGridTextBox Column?
"AMALORPAVANATH AN YAGULASAMY (AMAL)"
<AM************ *************** *@discussions.m icrosoft.com> wrote in message news:14******** *************** ***********@mic rosoft.com...
You have to set the KeyPress event to the TextBox Column only, not to the
Grid.

Regards,
Amal

"Darryn Ross" wrote:
Hi,

I am trying to catch the KeyPress event on my datagrid but it isn't
working... i have also tried registering the handler with the event like this...

dgGLBatch.KeyPr ess += new KeyPressEventHa ndler(dgGLBatch _KeyPress);

but nothing changed. I was wondering wether a custom table and column

style might have an effect on how this works???
my code is below...

private void dgGLBatch_KeyPr ess(object sender,
System.Windows. Forms.KeyPressE ventArgs e) {

if(e.KeyChar == (char)13)

SendKeys.Send(" {TAB}") ;

}
Regards

Darryn


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
37071
by: William Ortenberg | last post by:
I'm trying to capture when a user presses a particular key (escape), so I'm coding in the KeyPress event. Yet the code seems be bypassed (breakpoint is never encountered). Should I be coding in a different event? Is this a known issue? FYI, this is happening in both Access 97 and 2000.
4
5861
by: john sutor | last post by:
When moving up and down with the arrow keys on my DataGrid, I cannot get either the Keypress, KeyUp or KeyDown events to respond. I am putting breakpoints in to capture the event but they never get fired. Any input will be helpful. JOhn
7
7749
by: | last post by:
Hello to all I'm handling the Validating event for one text box. If something is wrong in user input I show a warning message. The problem is that if I add to method the message is displayed twice (event fired twice). Without event is fired once. if(txtMSG.Length > 0) {
4
4521
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters anything into the textbox (for instance) I trap the keypress event to handle some stuff (i.e. if it is an enter key, etc). Now, once I am done with...
3
3065
by: Terry Olsen | last post by:
Is there anyway to cause a KeyPress event in a datagrid cell? The only way I get a keypress event is if none of the cells are selected. I was hoping to have the program respond to a certain keypress while in a cell of a datagrid but it doesn't fire the keypress event.
8
3468
by: EdB | last post by:
I am testing in a TextBox KeyPress event to validate characters in the TextBox. How do I tell it to abort appending my "e" if I deem the character invalid. I note that on a Form Closing event, e offers a Cancel. Not on a textbox.
3
3642
by: JAG711 | last post by:
I have 2 mdi childforms which are database input forms. Each form has the usual add/delete/edit/save buttons and a few textboxes. I capture the keypress events on the textboxes to allow only numbers and I also capture the Enter key to move focus to the next control. The forms work fine if only one form is opened. If both forms are opened...
3
7269
by: Nikolay Evseev | last post by:
Hi, I am trying to trace down the Enter key in my Form.KeyPress event handler. The KeyPreview property is set to false, so I'd assume that all key presses should go through my form's KeyPress event handler, right? Ok. If the focus is set to any other control than a button, then the above event handler fires, but if the focus is on a button,...
0
7845
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8121
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8286
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7869
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3779
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2287
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1107
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.