I dont quite understand your question but here is a code snippet, is this what you were looking for?
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(dataGridView1.CurrentRow.Cells["Column Name"].Value.ToString()))
{
if (MessageBox.Show("Are You sure, You want to Hide?", "Hide confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
dataGridView1.Columns[dataGridView1.CurrentCellAddress.X].Visible = false;
}
}
else
{
if (MessageBox.Show("Are You sure you want to clear course?", "Clear Course", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
dataGridView1.Columns[dataGridView1.CurrentCellAddress.X].Visible = false;
}
}
}