datagridview problem?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • faizans
    New Member
    • Aug 2014
    • 1

    datagridview problem?

    i have problem in datagride view.i want to match all the rows of datagrid view rows one by one with specific value my code is given below it is not working ...
    Code:
    for(int i = 0; i < dataGridVie.RowCount;i++ ){
                    if(    dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "F7" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
                        count++;}
                for(int i = 0; i < dataGridVie.RowCount;i++ ){
                    if(dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "F3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
                        count++;
    
            }
                for(int i = 0; i < dataGridVie.RowCount;i++ )
                {
    
            if(  dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "T3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
                count++;
                }
                for(int i = 0; i < dataGridVie.RowCount;i++ )
                {
                   if(     dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "C3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave")
                       count++;}
                for(int i = 0; i < dataGridVie.RowCount;i++ ){
                     if(   dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "T5" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
                         count++;}*/
             /*   for(int i = 0; i < dataGridVies.RowCount;i++ )
                {
                             
                      if(  dataGridVies.Rows[i].Cells[0].Value.ToString().Trim() == "O2" && dataGridVies.Rows[i].Cells[1].Value.ToString() == "slow wave" )
                          count++;}
              /*  for(int i = 0; i < dataGridVie.RowCount;i++ )
                {if(      dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "P2" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave")
                    count++;}*/
                if(count==4)
                        
                    {
                        MessageBox.Show("");
                    }
Working...