Once I've selected multiple cells in a datagridview, I want my current cell to equal the first cell that is selected in the datagridview. The problem I'm having is, after the selection has been made (on mouse up), I set the current cell to the first selected cell (me.datagridview.currentcell =), but this removes all of the other selections in the datagridview. Does anybody know a way of changing the currentcell, without removing the datagridview selection. Current example code below:
Private Sub DataGridView1_CellMouseUp(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseUp
a = 0
Do While a < Me.DataGridView1.RowCount
b = 0
Do While b < Me.DataGridView1.ColumnCount
If Me.DataGridView1.Rows(a).Cells(b).Selected = True Then
Me.DataGridView1.CurrentCell = Me.DataGridView1.Rows(a).Cells(b)
GoTo skipstep
End If
b += 1
Loop
a += 1
Loop
skipstep:
End Sub