Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here code as follows;
for my above code how to use data grid view event handler.
C#
private void datagridView_CellEnter(object sender, DataGridViewCellEventHandler e)
{
 if (e.KeyCode == Keys.Space)
 {
   Message Box.Show("test");
 }
} 

here i use the above code but it is not working.it shows the error.

'System.Windows.Forms.DataGridViewCellEventHandler' does not contain a definition for 'KeyCode' and no extension method 'KeyCode' accepting a first argument of type 'System.Windows.Forms.DataGridViewCellEventHandler' could be found (are you missing a using directive or an assembly reference?) .
C#
if (e.KeyCode == Keys.Space)
 {
   Message Box.Show("test");
 }
for the above code in key code

private void datagridView_CellEnter(object sender, DataGridViewCellEventHandler e)
for the above line which datagriview event handler to be used.

please help me.

/Edit Code Block Added
Posted
Updated 6-Jan-13 20:31pm
v2

1 solution

If you look at the DataGridViewCellEventHandlerhttp://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcelleventhandler.aspx[^], KeyCode is absent.
Look for an alternate solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900