Private Sub DataGridView1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick
Try
Dim oIndex = e.RowIndex
Call AddRowToDGV2(oIndex)
Catch ex As Exception
End Try
End Sub
Sub AddRowToDGV2(ByVal intRowIndex As String)
Try
Dim row As DataGridViewRow = Me.DataGridView1.Rows(intRowIndex)
'This is where the row from the ist DGV is effectively copied and added to the second DGV
If row IsNot Nothing Then
Dim newRow As New DataGridViewRow()
newRow.CreateCells(Me.DataGridView1)
For i As Integer = 0 To row.Cells.Count - 1
newRow.Cells(i).Value = row.Cells(i).Value
Next
If Me.DataGridView1.Rows(row.Index).DefaultCellStyle.ForeColor <> Color.OrangeRed Then
'Don't add the row if it is already owolintshi
Me.DataGridView2.Rows.Add(newRow)
End If
End If
'***Color line orange -on the drop
Me.DataGridView1.Rows(row.Index).DefaultCellStyle.ForeColor = Color.OrangeRed
Catch
MsgBox("There was a problem calling the scenario loading from a drag and drop")
End Try
End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE