Hi guys about my previous post on Copy Selected rows from Datagrid to another that was answered by oussama_1 and Deep Modi, I was wodering if is it possible to detect that there is a similar row between the 2 Datarids to avoid redundancy? Does it require a datatable or dataset?
Jump to Post
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
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.