Link to home
Start Free TrialLog in
Avatar of Mr_Fulano
Mr_FulanoFlag for United States of America

asked on

DatagridView Selected Row

HI, I'm using VB 2005, WinForms. I have a DataGridView in which I highlight the selected row as follows:

myDGV.RowsDefaultCellStyle.SelectionBackColor = Color.LightSeaGreen

How do I programatically move the selected row from one row to the next? Lets say my selected row is row of index 10. How do I move the selection forward to row 13 or back to row 7?

Thanks,
Fulano
ASKER CERTIFIED SOLUTION
Avatar of lludden
lludden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Fulano

ASKER

Hi lludden, yes indeed you suggestion is correct. However, it leads me to a followup question, which I now see happening. If the selected row is outside the viewable area (way down at the bottom of the list) in the DGV, how do you make the DGV scroll up to the top of the viewable area -- or at least within the viewable area using your code?

Thanks,
Fulano
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi JPaulino, yes indeed. You're correct. Thank you very much.