Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winforms DataGrid: event with arrow keys

Status
Not open for further replies.

dpdg

Programmer
Joined
May 23, 2005
Messages
148
Location
US
My win forms project has a DataGrid in which I update the contents of an edited cell on the CurrentCellChanged event. That event only fires when you click the mouse in a different cell.

The problem is that most users are used to Excel where the event fires when you move from a cell with one of the 4 arrow keys. In the DataGrid this won't work. The CurrentCellChanged event doesn't fire when you press one of the arrow keys.

I've tried keypress, keydown, keyup, and all the rest to try to catch the key press of an arrow key when you move from one cell to the next. But there just isn't one.

How do I get an event to fire when focus moves from one cell to the next using the arrow keys?
 
By default the arrow and tab key works with DataGridView control. Here it's working absolutely fine with me. Try to delete and recreate that component once again.
I'm using VS2005...is it the same with you?

Sharing the best from my side...

--Prashant--
 
I'm using the DataGrid in VS2003. No events fire with the arrow keys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top