这段代码我不太明白,请教各位~!!

来源:百度知道 编辑:UC知道 时间:2024/06/01 01:12:29
//在当前工作溥写入内容
for (int i = 0; i < this.dataGridView1.RowCount; i++)
{

RSsheet.Cells[3 + i, 1] = this.dataGridView1[0, i].Value.ToString();
RSsheet.Cells[3 + i, 2] = this.dataGridView1[1, i].Value.ToString();
RSsheet.Cells[3 + i, 3] = this.dataGridView1[2, i].Value.ToString();
}
说明的详细点了,谢谢!!

for (int i = 0; i < this.dataGridView1.RowCount; i++) //循环语句,定义数值i等于0,i小于dataGridView1行数,如果小于,i一直+1
{

RSsheet.Cells[3 + i, 1] = this.dataGridView1[0, i].Value.ToString(); //赋值工作溥的坐标(单元格)=dataGridView1单元格的值
RSsheet.Cells[3 + i, 2] = this.dataGridView1[1, i].Value.ToString();
RSsheet.Cells[3 + i, 3] = this.dataGridView1[2, i].Value.ToString();
}

没用

看来貌似是给Excel的行列赋值???
RSsheet.Cells[3 + i, 1] Excel的坐标。。