Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two datagridviews as 1 and 2, I just need to compare the two datagridviews and remove duplicate values from datagridview 1 with match only 3 columns in two datagridviews (no need to read all the column values in single row, only specific columns to check the duplicate) to see the duplicate. Please support me.
Posted
Comments
ZurdoDev 17-Nov-14 14:40pm    
Where are you stuck?
abdulsafran 17-Nov-14 14:47pm    
Hi RyanDev, Thank you for the reply. I could't able to start since I just want to compare 3 columns in both datagridviews and remove need to done in only datagridview 1, I know how to select and remove data, but when it's come to large data, we couldn't able to do it manually, waiting for your support with sample coding.

int n1 = dataGridView2.CurrentCell.RowIndex;
dataGridView2.Rows.Remove(dataGridView2.Rows[n1]);
ZurdoDev 17-Nov-14 14:51pm    
Don't you just want to loop through the rows and if they don't match, remove them?
abdulsafran 17-Nov-14 14:54pm    
RyanDev, Datagridview2 have first column as checkbox and datagridview2 does not have checkbox, other columns are same. So how to match the full row?
ZurdoDev 17-Nov-14 15:00pm    
You just have to write code to do it.

Compare each column from each table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900