I have following problem.
I need to select multiple random rows in DatagridView with keypress.
Row2 -not selected
Row3 - selected
I do have part of code that will update certain field in database on keypress, but i have no idea how to create multiple selection and display it on DataGrid.
CTRL+Click is nice, but I would like to have option of selecting rows with keypress.
In following code I am checking if certain field is marked for selection(i want to give user an option to start selection, exit program then continue selection later) but it allways select all rows in table (even if only one is marked).
Dim NumRow As Integer NumRow = 0 Do Until NumRow = dbtShow.RowCount - 1 If dbtShow.Rows(dbtShow.CurrentRow.Index).Cells("Selected").Value.ToString() = "1" Then dbtShow.Rows(NumRow).Selected = True End If NumRow = NumRow + 1 Loop
My question is: What is the best way to select multiple random rows in code?
Thank you in advance.