M
Michael Hesse
This must have been covered a lot of times, but I still cannot seem to get
this work. I have a data table called "dt" and a data grid, "dg". The data
table is not part of a data set.
Here is my code. What am I doing wrong?
______________________________________
dg.SetDataBinding(dt, Nothing)
Dim dgts As DataGridTableStyle = New DataGridTableStyle
dgts.MappingName = "dt"
For i As Integer = 1 To 10
Dim CStyle As New DataGridTextBoxColumn
CStyle.Width = i * 100
dgts.GridColumnStyles.Add(CStyle)
Next
dg.TableStyles.Add(dgts)
dg.TableStyles("dt").GridColumnStyles(0).Width = 500
dg.TableStyles("dt").GridColumnStyles(1).Width = 2500
dg.Refresh()
_____________________________________________
Thanks for any help.
this work. I have a data table called "dt" and a data grid, "dg". The data
table is not part of a data set.
Here is my code. What am I doing wrong?
______________________________________
dg.SetDataBinding(dt, Nothing)
Dim dgts As DataGridTableStyle = New DataGridTableStyle
dgts.MappingName = "dt"
For i As Integer = 1 To 10
Dim CStyle As New DataGridTextBoxColumn
CStyle.Width = i * 100
dgts.GridColumnStyles.Add(CStyle)
Next
dg.TableStyles.Add(dgts)
dg.TableStyles("dt").GridColumnStyles(0).Width = 500
dg.TableStyles("dt").GridColumnStyles(1).Width = 2500
dg.Refresh()
_____________________________________________
Thanks for any help.