Formatting Datagrid
Sub DrawGrid()
DataGrid1.TableStyles.Clear()
With pDatagrid
.MappingName = "TeamPlayers"
.AlternatingBackColor = Color.LightGoldenrodYellow
.GridLineColor = Color.Black
.ForeColor = Color.Blue
End With
With Col2
.MappingName = "Players"
.HeaderText = "Player"
.Width = 260
.NullText = ""
pDatagrid.GridColumnStyles.Add(Col2)
End With
With Col3
.MappingName = "JerseyNumber"
.HeaderText = "Number"
.Width = 50
.NullText = ""
pDatagrid.GridColumnStyles.Add(Col3)
End With
DataGrid1.TableStyles.Add(pDatagrid)
End Sub
Sub BindChildData()
'
' Codes in here
....
'
Me.DataGrid1.DataSource = pTable
End Sub
When I use a Datareader then populate a table the code is A-OK but when I use a table from a function it doesn't have any effect.
Can anybody please tell me if what is wrong with my implementation or difference from a Table from a datereader and Dataadapter (did not use Dataset)
'Part of Function that returns a Table
Dim Mytable As New DataTable()
pDA.Fill(Mytable)
Proud To Be Pinoy
__________________
Proud To Be Pinoy
|