Hi all,
I can detect the active row (iRowIndex: see below please) and do whatever I
want, but I do not seem to be able to set a row to be selected.
How can I do that in vb.Net?
Private Sub DataGridView1_M ouseDown(etc... ..
Dim btnLeft = Windows.Forms.M ouseButtons.Lef t
If e.Button = btnLeft Then
Dim hit As DataGridView.Hi tTestInfo = DataGridView1.H itTest(e.X, e.Y)
If hit.Type = DataGridViewHit TestType.Cell Then
clickedCell = DataGridView1.R ows(hit.RowInde x).Cells(hit.Co lumnIndex)
iRowIndex = CInt(hit.RowInd ex)
etc...
I can detect the active row (iRowIndex: see below please) and do whatever I
want, but I do not seem to be able to set a row to be selected.
How can I do that in vb.Net?
Private Sub DataGridView1_M ouseDown(etc... ..
Dim btnLeft = Windows.Forms.M ouseButtons.Lef t
If e.Button = btnLeft Then
Dim hit As DataGridView.Hi tTestInfo = DataGridView1.H itTest(e.X, e.Y)
If hit.Type = DataGridViewHit TestType.Cell Then
clickedCell = DataGridView1.R ows(hit.RowInde x).Cells(hit.Co lumnIndex)
iRowIndex = CInt(hit.RowInd ex)
etc...
Comment