-
Datagrids - hide column
Hi,
Is there a way to hide a column in a datagrid?
I fill a datagrid with a table from a dataset. But I don't want to see all (customerid is not interesting to see but I need it for relation with other datatables). This is the code to fille the datagrid:
DGCustomers.DataSource = _
Database.DS_Customers.Tables("Customers")
' refresh the Datagrid
DGCustomers.Refresh()
Thanks, kleedje
-
-
Re: a better alternative
I always had the same problem till someone suggested this (on this site):
1. right click on your datagrid and select edit
2. select APEND (adding as many columns as you want to actually see in the grid)
3. right click on the same grid and this time select PROPERTIES
4. In the columns sections pick columns one by one, give them heading (if you want to do so) and bind them to specific columns from your table (data source).
This way you get the result much better without having to hide. You can also edit width of the columns wich gave me a major headache before finding this solution.
SW