By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,361 Members | 1,914 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,361 IT Pros & Developers. It's quick & easy.

Hiding Column in a WinForm DataGrid

P: n/a
Udi
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
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"Udi" <Ud*@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
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

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.