Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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
 
15/1/2013 1 tam(course)

 
Suppose user select the Mk column and click the Hide Button,user want to check in that Mk column values tam(course) is there.do u want to hide.
 
for that how to validate.
Posted 14-Jan-13 23:55pm
Edited 15-Jan-13 0:22am
v2
Comments
Orcun Iyigun at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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;
    }
}
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150326.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100