可能重复:
How to Fill TextBoxes from DataGridView on Button Click Event
我希望使用带有c#的vb.net在按钮点击事件中逐个填充DataGridView行中的texbox?
for (int i = 0; i < dgv_EmpAttList.Columns.Count; i++)
{
txt_EnrollNo.Text = this.dgv_EmpAttList.CurrentRow.Cells[0].Value.ToString();
txt_FirstInTime.Text = this.dgv_EmpAttList.CurrentRow.Cells[1].Value.ToString();
txt_LastOutTime.Text = this.dgv_EmpAttList.CurrentRow.Cells[2].Value.ToString();
txt_TotalHours.Text = this.dgv_EmpAttList.CurrentRow.Cells[3].Value.ToString();
}