Home > Back-end >  C # traversal datagridview, as long as it is with the keyword line will numerical up behind
C # traversal datagridview, as long as it is with the keyword line will numerical up behind

Time:09-24


Strives for the heavyweight directions

CodePudding user response:

Int itemp=0;
Foreach (DataGridViewRow DGR in dgvCheck. Rows)
{
for (int i=0; I & lt; DgvCheck. Rows. Count; I++)
{
for (int j=0; J & lt; DgvCheck. Columns. The Count; J++)
{
If (the Convert. ToString (dgvCheck. Rows [I] Cells [j]. Value)=="top-up")
{
Itemp=itemp + Convert. ToInt32 (dgvCheck Rows [I] Cells. [4] Value);
}
}
}
}
[code=csharp]

CodePudding user response:

Write the bosses like me?
  • Related