Ended up using the following to hide unwanted columns and set the width of a
column. Now I want to re-arrange the displayed order of the columns, so I
tried creating another table style and adding the columns in the order I
wanted them, but for some reason I end up with all table style settings
gone. Anyone see what I'm doing wrong?
Thanks - Sean
'Hide un-wanted column
Me.DsGameInfo.Tables("Games").Columns("Home").Colu mnMapping =
MappingType.Hidden
'Set column widths
Dim dgts As New DataGridTableStyle()
dgts.MappingName = "Games"
Me.dgGames.TableStyles.Add(dgts)
dgts.GridColumnStyles("Game").Width = 150
'Re-arrange colums
Dim dgts2 As New DataGridTableStyle()
dgts2.GridColumnStyles.Add(dgts.GridColumnStyles(" Game"))
dgts2.GridColumnStyles.Add(dgts.GridColumnStyles(" Home Score"))
dgts2.GridColumnStyles.Add(dgts.GridColumnStyles(" Guest Score"))
dgts2.GridColumnStyles.Add(dgts.GridColumnStyles(" Week / Year"))
Me.dgGames.TableStyles.Remove(dgts)
Me.dgGames.TableStyles.Add(dgts2)
Me.dgGames.Refresh()
"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:mSMcb.15428$0Z5.1761@lakeread03...
Have an Access table loaded into a DataTable that was created at run time,
and am displaying these contents in a data grid.
Me.dgGames.DataSource = Me.DsGameInfo.Tables("Games")
I would like to display only a selected few of the columns, rather than
the whole table.
Is this possible?
Thanks - Sean