当单击并更改背景颜色时,是否可以获取datagridview按钮列的null值;当列中的另一个按钮检查时,可以更改回默认颜色为dataGridView1.Columns[1].DefaultCellStyle.NullValue = "johndoe";
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
MessageBox.Show(dataGridView1[e.RowIndex, e.ColumnIndex].Value.ToString());
dataGridView1.Columns[1].DefaultCellStyle.BackColor = Color.Red;
}