获取datagridview列中button点击事件

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
string str = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
MessageBox.Show(str);
}
}
原文地址:https://www.cnblogs.com/valu/p/1732591.html