Help needed for VS.NET 2005

kunal.kb

Member
Joined
Sep 8, 2005
Messages
21
Programming Experience
Beginner
i have a gridview....
i am storing a value in a column...
i want that column to be hidden...
but when i make it visible=false....value is not getting filled in that column...
i want value to be in that column but not visible....
any one knows how to do this....
 
of course.. theres no point filling data for invisible columns

gridviews dont store data, they visualize it. the data storage container you might be looking for is the underlying datatable
 
Mmmm.... There is a point to hide cols .... I don't necessarily want my internal IDs for each row to be displayed in the grid.... so I would want to hide it. True they don't store it, but when you bind it to a DataTable, it would be nice to get rid of some of the unnecessary (as far as the user is cincerned) columns.

then again, after re-reading things, I'm not sure I even totaly understood the original quesiton.

-tg
 
I agree with TG.. normally when I make a DGView on a form, it is bound to the same type of datatable all the time, so i bind it at design time and it makes all the columns for me

I then go in and remove columns i dont want the user to see (actually remove then from the gridview properties Columns collection) but this doesnt remove the column from the underlying datatable..

Then, if i've set the datasource of the DGView to be a datatable i can do this in code:

VB.NET:
Dim dt as DataTable = DirectCast(myDGView.DataSource, DataTable)

dt now gives me access to ALL the columns the DGView could show (the underlying data).. not jsut the ones on show
 
Last edited by a moderator:
Back
Top