I have DataSet
which is not null. It have 16 rows,
but my grid have no rows. I have bindingSource
, here is some code:
bindingSource.DataSource = ds.Tables[0]; //ds is DataSet
grid.DataSource = bindingSource;
double sum1 = 0;
for (int i = 0; i < grid.Rows.Count; ++i)
{
sum1 += Convert.ToDouble(grid.Rows[i].Cells[13].Value);
}
When I start debugging, when it comes to i < grid.Rows.Count
it just jump out of for loop. Any idea why is that happening?