472,119 Members | 1,675 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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.KeyPress += new KeyPressEventHandler(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_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) {

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

SendKeys.Send("{TAB}") ;

}
Regards

Darryn
Nov 16 '05 #1
3 7152
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.KeyPress += new KeyPressEventHandler(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_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs 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
DataGridTextBoxColumn?
"AMALORPAVANATHAN YAGULASAMY (AMAL)"
<AM****************************@discussions.micros oft.com> wrote in message
news:14**********************************@microsof t.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.KeyPress += new KeyPressEventHandler(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_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) {

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

SendKeys.Send("{TAB}") ;

}
Regards

Darryn

Nov 16 '05 #3
try DataGridTextBoxColumn.TextBox.KeyPress.

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

Visit www.syncfusion.com for the coolest tools

"Darryn Ross" <da****@datawave.com.au> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
And how do you do that when there is no KeyPress event under
DataGridTextBoxColumn?
"AMALORPAVANATHAN YAGULASAMY (AMAL)"
<AM****************************@discussions.micros oft.com> wrote in message news:14**********************************@microsof t.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.KeyPress += new KeyPressEventHandler(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_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e) {

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

SendKeys.Send("{TAB}") ;

}
Regards

Darryn


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by William Ortenberg | last post: by
4 posts views Thread by john sutor | last post: by
3 posts views Thread by Terry Olsen | last post: by
3 posts views Thread by Nikolay Evseev | last post: by
reply views Thread by leo001 | last post: by

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.