j k

j k

  • NA
  • 34
  • 0

Datagridview

Jun 19 2013 11:38 AM
Hi All,
first of all thanks for the time you are putting in reading this.
i need assistance in the following.

i have a datagridview in which is being filled from a database.
what i want to do is the following:

check a specific cell in a row and compare it to the previous one. in case they are the same do one thing, in case they are different do another one.

for example:
the datagridview has a column name, long, lat.

Row         Name                 Long                        Lat
1                AZ1                        55.555522        55.555522        
2                AZ1                        55.555533        55.555533    
3                AZ1                        55.555544        55.555544    
4                AZ1                        55.555555        55.555555    
5                AZ2                        55.555522        55.555522       
6                AZ2                         55.555533         55.555533    
7                AZ2                         55.555544         55.555544    
8                AZ2                         55.555555         55.555555   

and so on.

what i want to do the following:

if row[2].cell[name] = row[1].cell[name]
{
do XXXXXXXXXXXXXXXXX
}
else
{
do yyyyyyyyyyyyyyyyyyyyy
}


hope i am clear.

once again.
thanks


Answers (9)