Click here to Skip to main content
Rate this: bad
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 u want to hide.
for that how to validate.
Posted 14-Jan-13 23:55pm
Edited 15-Jan-13 0:22am
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
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;

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

  Print Answers RSS
0 Peter Leow 313
1 Kornfeld Eliyahu Peter 220
2 Maciej Los 160
3 Sergey Alexandrovich Kryukov 157
4 OriginalGriff 153
0 Peter Leow 443
1 OriginalGriff 403
2 Kornfeld Eliyahu Peter 260
3 Sergey Alexandrovich Kryukov 242
4 Maciej Los 230

Advertise | Privacy | Mobile
Web01 | 2.8.150301.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