如何读取下一行DataGridView



如何读取DataGridView和SetAttribute?我一直在做这个:

(string)dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value)

读取第一行,但我需要读取0,然后读取下一行(1,在第一秒之后等)

我已经研究过这个问题:DataGridView导航到下一行

但我不知道怎么写。

这是我现在要阅读的代码:

webBrowser1.Document.GetElementById("pass").SetAttribute("value", (string)dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value);

使用for循环逐个遍历所有行的

for(int i=0;i<datagrid.Rows.Count;i++){
    val=datagrid[0,i].Value.Tostring();   // 0 is column no
}

或者通过手动增加行计数一段时间。。

最新更新