get focus on row off datagridview

Richnl

Well-known member
Joined
Mar 20, 2007
Messages
93
Programming Experience
Beginner
Hi,
I have a datagridview with a constraint datasource
With navigation buttons I move threw the primarykey table and then it shows related data in the gridview.
The first row is always selected first.
I want to use the computer arrow keys to move up and down the rows
It works if I first select a row, but I want to avoid that.

dgv.select
dgv.currentrow.selected=true
me.selectcontrol

will not work

Thanks in adv, Richard
 
Attach an eventhandler to the Form's KeyPress (and think also set KeyPreview to true) and then make the Bindingsource.Position be altered by the key presses
 
Back
Top