Click here to Skip to main content
12,754,090 members (31,077 online)
Rate this:
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
Updated 15-Jan-13 0:22am
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

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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2017
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