.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Code Snippets >> Windows Form Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Hide DataGridView Columns at runtime in windows application

Posted By:Praveen       Posted Date: January 27, 2009    Points: 10    Category: Windows Form Controls    URL: http://www.dotnetspark.com  

Hide DataGridView Columns at runtime is so easy in windows application. Just you need to set Columns property to false using code.

Lets see how can we do that

Suppose you have a DataGridView Control name dataGridView1 and its has a column "Ack" in it and we want to hide this "Ack" column in runtime

Using c# Code

this.dataGridView1.Columns["Ack"].Visible = false;

Using Vb.Net Code

Me.dataGridView1.Columns("Ack").Visible = false

Hope this will help all who want to hide the column from a datagridview at runtime using code.

Happy Coding!!!


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend