D
Daniel
Hi all. Help! What am I doing wrong? My datagrid works fine, the
columns are created and the data is filled. However, I just cannot
resize the column widths to what I want them to be. I created a
TableStyle but it is ignored. :-(
I am using this code:
Dim DS As New DataSet
Dim MyTable As New DataTable
Dim Col0 As New DataColumn
Dim Col1 As New DataColumn
Dim Col2 As New DataColumn
DS.Tables.Add(0)
DS.Tables(0).Columns.Add(Col0)
DS.Tables(0).Columns(0).ColumnName = "Checked"
DS.Tables(0).Columns.Add(Col1)
DS.Tables(0).Columns(1).ColumnName = "Path"
DS.Tables(0).Columns.Add(Col2)
DS.Tables(0).Columns(2).ColumnName = "Node"
Dim newRow As DataRow
newRow = DS.Tables(0).NewRow
newRow.Item("Checked") = False
newRow.Item("Path") = datSplit(0)
newRow.Item("Node") = NodeName
DS.Tables(0).Rows.Add(ErrRow)
myDataGrid.DataSource = DS
myDataGrid.SetDataBinding(DS, DS.Tables(0).ToString)
columns are created and the data is filled. However, I just cannot
resize the column widths to what I want them to be. I created a
TableStyle but it is ignored. :-(
I am using this code:
Dim DS As New DataSet
Dim MyTable As New DataTable
Dim Col0 As New DataColumn
Dim Col1 As New DataColumn
Dim Col2 As New DataColumn
DS.Tables.Add(0)
DS.Tables(0).Columns.Add(Col0)
DS.Tables(0).Columns(0).ColumnName = "Checked"
DS.Tables(0).Columns.Add(Col1)
DS.Tables(0).Columns(1).ColumnName = "Path"
DS.Tables(0).Columns.Add(Col2)
DS.Tables(0).Columns(2).ColumnName = "Node"
Dim newRow As DataRow
newRow = DS.Tables(0).NewRow
newRow.Item("Checked") = False
newRow.Item("Path") = datSplit(0)
newRow.Item("Node") = NodeName
DS.Tables(0).Rows.Add(ErrRow)
myDataGrid.DataSource = DS
myDataGrid.SetDataBinding(DS, DS.Tables(0).ToString)