Hide Datagrid column when autogenerateColumns = "True"

G

Guest

How can you hide a column in a datagrid when you have autogenerateColumns = "true"? In VB.Net useing a Windows Form

There are no Grid TableStyles or ColumnsStyles
 
G

Guest

The Answer is
Dim SearchResults As DataSet = WebServiceCall(parm1, pram2
Dim strTest As String = SearchResults.GetXm
If Not (strTest = "<NewDataSet />") The
If Not (SearchResults.Tables(0).ToString = "Error") The
' this hides the column you wish to hid
SearchResults.Tables(0).Columns(44).ColumnMapping = MappingType.Hidde
SearchResults.Tables(0).Columns(45).ColumnMapping = MappingType.Hidde
SearchResults.Tables(0).Columns(46).ColumnMapping = MappingType.Hidde
SearchResults.Tables(0).Columns(47).ColumnMapping = MappingType.Hidde
' bind to datagrid
Me.DataGrid1.DataSource = SearchResult
Me.DataGrid1.DataMember = "SearchResult"
End i
End if
 

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