Hiding VB.NET datagrid columns

ahbenshaut

Well-known member
Joined
Oct 29, 2004
Messages
62
Location
Alaska
Programming Experience
5-10
I have a quick (hopefully) question. I have a datagrid that is populated using a dataset. However, when the user views the form, there are a couple of columns that I would like to hide from the user but still be able to access the data in them. The Primary Key for example..

Any help is greatly appreciated. :confused:
 

mzim

Well-known member
Joined
Jun 3, 2004
Messages
187
Location
Other side of the rock
Programming Experience
1-3
set the width of your datagridtextboxcolumn to 0.
 

ahbenshaut

Well-known member
Joined
Oct 29, 2004
Messages
62
Location
Alaska
Programming Experience
5-10
Could you give me some more information? New to VB.NET so how/where do I make this change??

thanks again
 

Tsinghua

New member
Joined
Jan 20, 2005
Messages
1
Programming Experience
1-3
You may also set the visible property to False

Try gridName.Cols(colIndex).Visible = False
 
Top Bottom