Question Compare Values between two datagridview

karthik82.vk

Member
Joined
Oct 31, 2012
Messages
8
Programming Experience
Beginner
Hi,

I am working on a tool for my project that will compare two contents pasted in two different datagridviews. I have previously created the same in VB6.0 and it worked fine. I am a beginner of .net and I dnt know how to get each cell values from datagridview and compare it with the other.

Can any one help me with this by providing me sample code of getting the cell values from each datagridview and compare it with another? it will be highly helpful for my project.

Thanks in advance,
Karthik
 
You could use two nested loops. The Item property of the grid takes a column index and a row index to get the cell at those coordinates and the cell has a Value property. You might also want to test the ColumnCount and/or RowCount properties if they might be different.
 
Back
Top