hide a column programatically

B

Bruno Alexandre

Hi guys,

How can I HIDE a GridView Column programatically?

I have a column that has the prices, but I only want the user view the
prices if they enter the correct password, at this time I have 2 gridviews I
use the visible property to change between them...

but can I do this having just one gridview and hide the column like
GridView1.ColumnHeaderName.visible = False ?

--


Thank you in Advance.

Bruno Alexandre
(a Portuguese in Denmark)
 
M

Manikandan

Hi Bruno !



Hope this code will help you resolve the issue you access the specific
column and set it visible property to false ,
like this

DataGridView.Columns["ColumnName"].Visible = false;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top