Hide Datagrid column when autogenerateColumns = "True"

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top