Visual c#中的DatagridView单元格单击事件

时间:2017-02-24 03:57:00

标签: c# vb.net winforms datagridview

我正在学习Windows Visual C#所以我是新手。我有这个代码用于我的DataGridView的单元格点击事件

 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
      con.  ID = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
      txtname.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
      txtlname.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
    }
  

问题是:即使我点击我的DataGridView多少次它没有触发我的断点。怎么解决这个问题?

0 个答案:

没有答案
相关问题