Getting data from selected datagridview row and which event?

后端 未结 5 1357
眼角桃花
眼角桃花 2020-12-08 06:53

I have a DataGridView (Selectionmode: FullRowSelect) on a windows form along with some textboxes, so what i want to do is that whenever a user selects a row(click or double_

5条回答
  •  春和景丽
    2020-12-08 07:21

    You should check your designer file. Open Form1.Designer.cs and
    find this line: windows Form Designer Generated Code.
    Expand this and you will see a lot of code. So check Whether this line is there inside datagridview1 controls if not place it.

    this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); 
    

    I hope it helps.

提交回复
热议问题