KeyPress Event not Firing???

  • Thread starter Thread starter Darryn Ross
  • Start date Start date
D

Darryn Ross

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
 
You have to set the KeyPress event to the TextBox Column only, not to the Grid.

Regards,
Amal
 
And how do you do that when there is no KeyPress event under
DataGridTextBoxColumn?


"AMALORPAVANATHAN YAGULASAMY (AMAL)"
 

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

Back
Top