loop datagridview c#

C#
foreach (DataGridViewRow row in datagridviews.Rows)
{
   currQty += row.Cells["qty"].Value;
   //More code here
}
Source

Also in C#: