Hiding Column in a WinForm DataGrid

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
 
J

Jared

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
 

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

Top