Hiding Column in a WinForm DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone!
I have a major problem with the DataGrid control for the Windows Form!
I am using the DataAdapter to get data from Sql Server 2000 DataBase and
populating a DataGrid with the Table i got.

The problem is that i dont want to see all the table columns in the
DataGrid, only some of it, how can i hide those unwanted columns?
I cannot just not SELECTing it because i need to Update and Insert...

Remember that i am using the WinForm DataGrid and not the ASP.NET.

Thanks very much
Udi Hakim
 
You can set the columnmapping to hidden in your datasource.

Dim ds As New DataSet
For Each col As DataColumn In ds.Tables(0).Columns
col.ColumnMapping = MappingType.Hidden
Next
 
Back
Top