I have a Datagridview DGV_Historial_Ventas with the sales records and another DGV_Historial_Ventas_Articulos with the items of the sale selected in the first one (DGV_Historial_Ventas)
The DGV_Historial_Ventas has the property multirow , that is to say that I can choose several sales so that in the DGV_Historial_Ventas_Articulos all the articles that belong to those sales are displayed.
Everything works perfect, when I select several rows with CTRL or with SHIFT. But if I make a selection with the mouse (drag and drop) the event does not fire:
Private Sub DGV_Ventas_Historial_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DGV_Ventas_Historial.CellClick
If DGV_Ventas_Historial.RowCount > 0 And DGV_Ventas_Historial.SelectedRows.Count > 0 Then
LlenaTablaVentahistorialArticulo(DGV_Ventas_Historial.SelectedRows)
LlenaGridVentaHistorialArticulo(DGV_Ventas_Historial_Articulos)
Label_Ventas_HistorialArticulos_Total.Text = "Total: " & DGV_Ventas_Historial.Item("TotalArticulos", e.RowIndex).Value.ToString & " Articulos"
Else
If DGV_Ventas_Historial.SelectedRows.Count = 0 Then DGV_Ventas_Historial_Articulos.DataSource = ""
End If
End Sub
I thought about using the MouseUp event but it uses and the DataGridViewCellMouseEventArgs which has mouse coordinates and I do not know how to use it.
In CellClick use e as DataGridViewCellEventArgs whereby I can use e.rowindex to know the row that is being clicked (which is something I need)