Sorry for asking again, but i'm having problems with datagird...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want the enter key press wll be an event
this is my eventhandler header
this.dataGrid1.KeyPress+=new System.Windows.Forms.KeyPressEventHandler(this.dataGrid1_KeyPress)
is it ok
and how do i write the method, the datagrid doesn't react when i press any key (i tried to debug and i saw that nothing happens when i press any key

i read the link that i got from here but it didn't help me to understand how to do it..
thnak yo
 
Hi,

With the grid, it's not that simple.

You can intercept the Enter keystroke by inheriting from the grid and
overriding the following methods:

ProcessCmdKey
ProcessKeyPreview
ProcessDialogKey

The first one might me unnecessary to override, I might have used it to
catch only some very grid-specific keystrokes like the Del key.

Gidi said:
i want the enter key press wll be an event.
this is my eventhandler header:
this.dataGrid1.KeyPress+=new System.Windows.Forms.KeyPressEventHandler(this.dataGrid1_KeyPress);
is it ok?
and how do i write the method, the datagrid doesn't react when i press any
key (i tried to debug and i saw that nothing happens when i press any key)
 
Back
Top