Question DataGridView Focus

prosys

Member
Joined
Aug 7, 2008
Messages
13
Programming Experience
Beginner
Hi All,
i am using DataGridView for Data binding. it works fine.
i wrote a coding retrieve current row's DATA when press enter key in DataGridView

it works fine,but when i pressed enter key datagridview focus is move to next row, so that it will retrieve the latest focus data, but i want data from the enter key press.

how i resolve this?

thanks for advance
 

Tom

Well-known member
Joined
Aug 23, 2005
Messages
746
Programming Experience
5-10
It is suppose to move to the next row... Changes to a datarow fire when moving from the row to another; clicking enter triggers this.
 

virgel

New member
Joined
Mar 23, 2010
Messages
2
Programming Experience
Beginner
Private Sub DataGridView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True
endif
end sub
 
Top Bottom