Click here to Skip to main content
14,971,280 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have one button called hide.

when i click that button i want to check in that column values are there.

Hide Button Code as follows;

private void Btn_Hide_Click(object sender, EventArgs e)
             //confirmation to Hide the column
        datagridView.Columns[datagridView.CurrentCellAddress.X].Visible = false;

output as follows; Button(Hide)

Date      Period     RK    Mk  CK VK GS VB   CM   <br />
<br />
 15/1/2013  1               tam(course)<br />

Suppose user select the Mk column and click the Hide Button,user want to check in that Mk column values tam(course) is u want to hide.

for that how to validate.
Updated 14-Jan-13 23:22pm
Orcun Iyigun 15-Jan-13 5:27am
This is not the way how to LEARN programming!!! You are not showing enough effort. I think you should take your time into reading some books before diving into programming..

1 solution

It will ask the user for conformation. Just follow the simple steps given below:
private void Btn_Hide_Click(object sender, EventArgs e)
    if (MessageBox.Show("Are You sure, You want to Delete?", "Delete Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes){
        datagridView.Columns[datagridView.CurrentCellAddress.X].Visible = false;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900