在 for (int j = 0; j < dataGridView1.RowCount; j++)
if (dataGridView1.Rows[j].Cells[2].Value.ToString() == xmmc)
{
dataGridView1.Rows[j].Cells[0].Value = true;
}
使用"dataGridView1.Rows[j].Cells[0].Value = true;"这样的语句会让程序运行变慢好多,有谁遇到类似问题的吗,这个循环次数是1900,为什么会很慢呢DataGridView
if (dataGridView1.Rows[j].Cells[2].Value.ToString() == xmmc)
{
dataGridView1.Rows[j].Cells[0].Value = true;
}
使用"dataGridView1.Rows[j].Cells[0].Value = true;"这样的语句会让程序运行变慢好多,有谁遇到类似问题的吗,这个循环次数是1900,为什么会很慢呢DataGridView
{
int hjcs = int.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString());
float sjsf = float.Parse(dataGridView1.Rows[i].Cells[4].Value.ToString());
int sfcs = int.Parse(dataGridView1.Rows[i].Cells[5].Value.ToString());
if (sjsf > 0)
{
zlxwfje = sjsf * sfcs * hjcs;
zlxwfjezj = zlxwfjezj + zlxwfje;
//dataGridView1.Rows[i].Cells[1].Value = zlxwfje.ToString("n");
}
}
这样也很慢,我不清楚拿出来再放进去是不是这样理解的
然后循环这个对象处理数据在把这个对象赋回去