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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.