如何使用c#在VB.net中的按钮点击事件中从DataGridView填充TextBox?

时间:2011-10-14 05:09:14

标签: c# vb.net

  

可能重复:
  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();
}

0 个答案:

没有答案