caohuan95568
caohuan95568
2015-03-24 12:02

在dataview中选取一行显示在各个textbox中

  • c#
  • foreach
  • datagridview

foreach (int i in dataGridView1.CurrentRow.Index)//“int”不包含“GetEnumerator”的公共定义,因此 foreach 语句不能作用于“int”类型的变量
{
GlobalVariable.XiuZhengLunMingCheng = dataGridView1.Rows[i].Cells[1].Value.ToString();
GlobalVariable.XiuZhengLunZhiJing = dataGridView1.Rows[i].Cells[2].Value.ToString();
GlobalVariable.XiuZhengLunYuanJiaoBanJing1 = dataGridView1.Rows[i].Cells[3].Value.ToString();
GlobalVariable.XiuZhengLunYuanJiaoBanJing2 = dataGridView1.Rows[i].Cells[4].Value.ToString();
GlobalVariable.JuLi1 = dataGridView1.Rows[i].Cells[5].Value.ToString();
GlobalVariable.JuLi2 = dataGridView1.Rows[i].Cells[6].Value.ToString();
GlobalVariable.XiuZhengLunXiuZhengGaoDu = dataGridView1.Rows[i].Cells[7].Value.ToString();

            //MessageBox.Show(Convert.ToString(GlobalVariable.m_GrindingWheelSelected));
        }
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐