G
Guest
I am using the following code to format a DataGrid:
aGridTableStyle.MappingName = "schedule"
With acol1
.MappingName = "Week"
.HeaderText = "Week"
.Width = 25
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With acol2
.MappingName = "Away"
.HeaderText = "Away"
.Width = 70
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With acol3
.MappingName = "Home"
.HeaderText = "Home"
.Width = 70
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With aGridTableStyle.GridColumnStyles
.Add(acol1)
.Add(acol2)
.Add(acol3)
End With
DataGrid1.TableStyles.Add(aGridTableStyle)
DataGrid1.DataSource = ds.Tables("Schedule")
DataGrid1.Expand(-1)
DataGrid1.NavigateTo(0, "schedule")
When I run my program, the datagrid displays week, away, and home twice (week away home week away home). Help!
aGridTableStyle.MappingName = "schedule"
With acol1
.MappingName = "Week"
.HeaderText = "Week"
.Width = 25
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With acol2
.MappingName = "Away"
.HeaderText = "Away"
.Width = 70
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With acol3
.MappingName = "Home"
.HeaderText = "Home"
.Width = 70
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With aGridTableStyle.GridColumnStyles
.Add(acol1)
.Add(acol2)
.Add(acol3)
End With
DataGrid1.TableStyles.Add(aGridTableStyle)
DataGrid1.DataSource = ds.Tables("Schedule")
DataGrid1.Expand(-1)
DataGrid1.NavigateTo(0, "schedule")
When I run my program, the datagrid displays week, away, and home twice (week away home week away home). Help!