winform dataGridView中的button点击判断

 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewColumn column = dataGridView1.Columns[e.ColumnIndex];
if (column is DataGridViewButtonColumn)
{
//要做的事
dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString()//获取点击行的第二个表格的值
}
}
}

  

上一篇:[Recompose] Merge RxJS Button Event Streams to Build a React Counter Component


下一篇:【linux】Ubuntu20.04使用apt安装tomcat9