title: c# read a fields value from a row in a datagridview looping
body: <p>Ok so i have a lil function that will get a value from a field in each row of a datagridview..........
  then look at what the value is and count an according increment.</p>
  
  <p>heres the code so far:</p>
  
  <pre><code>    private void countParetoQty(int top, int tmid, int bmid, int bot )
      {
          //bunch of Ifs to count a record thats certain pareto
  
          foreach(DataGridViewRow row in dataGridView1)
          {
              if(//current row @ pareto &lt;=50)
              {
                  //top 50
                  top++;
              }
              else 
                  if()
                  {
                      //50-100
                      tmid++;
                  }
                  else
                      if()
                      {
                          //100-200
                          bmid++;
                      }
                      else
                      {
                          //its over 200!!!!!!!!!!!!!!
                          bot++;
                      }
          }
  </code></pre>
  
  <p>as you can see i need to check the fields value "Pareto" on each row and cycle through afew If statements to increment the correct int.
  I need to know how i get the value im looking for an cycle through.
  Im thinking along the lines of foreach loop then conditioning by the current rows column.value?
  Many thanks in advance!</p>