2
Contributors
2
Replies
13
Views
3 Years
Discussion Span
Last Post by oussama_1
0

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 by jared.geli

0
        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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.