KeyPress Event not Firing???  
Author Message
FatBear





PostPosted: Wed Aug 18 21:05:02 CDT 2004 Top

Visual C#.Net >> 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

DotNet318  
 
 
AMALORPAVANATHANYAGULASAMYAMAL





PostPosted: Wed Aug 18 21:05:02 CDT 2004 Top

Visual C#.Net >> KeyPress Event not Firing??? You have to set the KeyPress event to the TextBox Column only, not to the Grid.

Regards,
Amal



> 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
>
>
>
 
 
Darryn





PostPosted: Wed Aug 18 21:39:46 CDT 2004 Top

Visual C#.Net >> KeyPress Event not Firing??? And how do you do that when there is no KeyPress event under
DataGridTextBoxColumn?


"AMALORPAVANATHAN YAGULASAMY (AMAL)"


> You have to set the KeyPress event to the TextBox Column only, not to the
Grid.
>
> Regards,
> Amal
>

>
> > 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
> >
> >
> >


 
 
ClayB





PostPosted: Thu Aug 19 03:52:02 CDT 2004 Top

Visual C#.Net >> KeyPress Event not Firing??? try DataGridTextBoxColumn.TextBox.KeyPress.

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

Visit www.syncfusion.com for the coolest tools



> And how do you do that when there is no KeyPress event under
> DataGridTextBoxColumn?
>
>
> "AMALORPAVANATHAN YAGULASAMY (AMAL)"

message

> > You have to set the KeyPress event to the TextBox Column only, not to
the
> Grid.
> >
> > Regards,
> > Amal
> >

> >
> > > 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
> > >
> > >
> > >
>
>