更新时间:2023-01-27 18:27:58
请点击此链接使用ASP.NET的GridView提示与技巧2.0 [ ^ ]
试试这个...
1.选择datagridview的点击事件
2.查找行索引,如...
try this...
1.select click event of datagridview
2.find row index like...
int row = dgvReleaseOrder.CurrentCell.RowIndex;
3.使用循环
3.using for loop
for (int row = 0; row < dgvReleaseOrder.Rows.Count - 1; row++)
{
txt1.text = dgvReleaseOrder.Rows[row].Cells[1].Value.ToString();
txt2.text = dgvReleaseOrder.Rows[row].Cells[2].Value.ToString();
txt3.text = dgvReleaseOrder.Rows[row].Cells[3].Value.ToString();
txt4.text = dgvReleaseOrder.Rows[row].Cells[4].Value.ToString();
txt5.text= dgvReleaseOrder.Rows[row].Cells[5].Value.ToString();
txt6.text = dgvReleaseOrder.Rows[row].Cells[6].Value.ToString();
txt7.text= dgvReleaseOrder.Rows[row].Cells[7].Value.ToString();
txt8.text = dgvReleaseOrder.Rows[row].Cells[8].Value.ToString();
txt9.text= dgvReleaseOrder.Rows[row].Cells[9].Value.ToString();
txt10.text= dgvReleaseOrder.Rows[row].Cells[10].Value.ToString();
}
快乐编码
happy coding