title: how to count the gridview cell
body: <p>I want to count the <code>GridView</code> total number, what's wrong with my <code>for</code> loop?</p>
  
  <pre><code>public void Bind()
  {
       //Assign the datasource to GridView
       this.grdCart.DataSource = Get_Arealist();
       //Databind the grid 
       this.grdCart.DataBind();    
  
       decimal a = 0, c = 0;
       for (int i = 0; i &lt;= (grdCart.Rows.Count); i++)
       {
           a = Convert.ToDecimal(grdCart.Rows[i].Cells[3].Text.ToString());
           c = c + a; //storing total qty into variable 
           c++;
       }
       Label2.Text = c.ToString();
  }
  </code></pre>