button click event in datagridview

后端 未结 2 1870
感情败类
感情败类 2021-01-13 09:17

I am having a button cell in datagridview.When that button is clicked,another datagridview should be visible .For every button click in the button column,the data in new dat

2条回答
  •  盖世英雄少女心
    2021-01-13 10:16

    use dataGridView1_CellContentClick instead of dataGridView1_CellClick

    private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
    
        if (e.ColumnIndex == 8) //make sure button index here
        {
              //write your code here
        }
    
    }
    

提交回复
热议问题