Additional info: After it detects a duplicate the user will have an option to replace the old row with a new row? Example:

'DataGridView1: Item List

id item       order
1  bleach     5       '<--------Edited Value




'DataGridView1: Order List

id item       order
1  bleach     3       '<--------Old Value

After editing in DataGridView1, the system will prompt the user if they want to replace the existing order in DataGridView2 with the value in DataGridView1. I'm using CellEndEdit event for this.

Edited 2 Years Ago by jared.geli

        For indx = 0 To DataGridView2.Rows.Count - 1
            If DataGridView1.CurrentRow.Cells("ID").Value = DataGridView2.Rows(indx).Cells(1).Value Then
                Dim ask = MessageBox.Show("Record Already Exist, Replace existing record ?", "Records", _
                                          MessageBoxButtons.YesNoCancel)
                If ask = DialogResult.Yes Then
                    ''copy code
                End If
            Else
                ''copy code
            End If
        Next
This article has been dead for over six months. Start a new discussion instead.