Hi,
You can also set the currentCell property.
The following code will highlight two cells. If you set the editmode to editOnKeyStrokeOrF2 or EditOnF2, then press F2, currentcell (Rows(0).Cells(2) ) will begin edit.
dataGridView1.CurrentCell = dataGridView1.Rows(0).Cells(2)
dataGridView1.Rows(0).Cells(1).Selected = true
More information:
DataGridViewCell.Selected Property
Gets or sets a value indicating whether the cell has been selected.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.selected.aspx
DataGridView.CurrentCell Property
Gets or sets the currently active cell.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell.aspx
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.