dotnet windows forms databinding:
I know that there is something stupid here, but I am pulling my hair out
trying to find it, Please help!!. I have a Form that, with various Tab Pages,
has 6 DataGrids. 5 of these DataGrids are using the defined table style and
one won't. I can't find anything different between them.
One that is working:
Me.DataGrid1.DataSource = dsBhvPlan
Me.DataGrid1.DataMember = "BhvPlan"
Dim ts1 As New DataGridTableStyle
ts1.MappingName = "BhvPlan"
With ts1.GridColumnStyles
ts1.GridColumnStyles.Add(New DataGridTextBoxColumn)
With .Item(0)
.HeaderText = "Objective Nunber"
.MappingName = "objno"
.Width = 0.2 * Me.DataGrid1.Width
.NullText = String.Empty
End With
ts1.GridColumnStyles.Add(New DataGridTextBoxColumn)
With .Item(1)
.HeaderText = "Title"
.MappingName = "title"
.Width = 0.78 * Me.DataGrid1.Width
.NullText = String.Empty
End With
ts1.GridColumnStyles.Add(New DataGridTextBoxColumn)
DataGrid1.TableStyles.Add(ts1)
End With
Me.DataGrid1.CaptionVisible = False
The one that won't work:
Me.DataGrid2.DataSource = dsBtarget
Me.DataGrid2.DataMember = "Btargets"
Dim ts2 As New DataGridTableStyle
ts2.MappingName = "Btargets"
With ts2.GridColumnStyles
ts2.GridColumnStyles.Add(New DataGridTextBoxColumn)
With .Item(0)
.HeaderText = "Targeted Behavior"
.MappingName = "type"
.Width = 0.28 * Me.DataGrid2.Width
.NullText = String.Empty
End With
ts2.GridColumnStyles.Add(New DataGridTextBoxColumn)
Me.DataGrid2.TableStyles.Add(ts2)
End With
Please let me know of anything that you see, I'm going Crazy!
Thanks,
Craig
--
Message posted via
http://www.dotnetmonster.com