Gary,
Create a DataGridStyle
and Add the columns from the DataTable to it
something like:
Function CreateGridStyle(ByVal t AS DataTable) AS DataGridStyle
CreateGridStyle = New DataGridStyle
CreateGridStyle.MappingName= t.TableName
With CreateGridStyle
..ReadOnly = False 'Make DataGrid read Only
.. BackColor=Color.AntiqueWhite ' Sets back colour, note Colour is spelt
wrong in VB & Dot Net
'Add other properties
Dim Col1 As New DataGridTextBoxColumn
with Col1
..MappingName= "MyFirstColumn" 'Name of Field you want to display
..Width = 80 'Width of Column
..Alignment= HorizontalAlignmentLeft 'Field Justification
..readOnly = true 'Makes Column read Only
..HeaderText = "Column 1" 'Header for Column 1
..NullText = "" 'Value to use if Data value is Null
'Add other properties if you need them
End With
..GridColumnStyle.Add(Col1) 'Adds Col1 to the Data Grid
End With
End Function
"Didymus" <di************@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP15.phx.gbl...
Hello Everyone,
I have a DataAdapter with for columns of data.
I want to only display the first two columns of data in the DataSet.
How can I do this?
Thanks,
Gary