how to change the width of the datagrid header text ...
and the width of the column
Printable View
how to change the width of the datagrid header text ...
and the width of the column
VB Code:
'returns a datatable sqlDA.Fill(ds, "DataSet") DataGrid1.DataSource = dbMgr.getInstance.GetTableData(l_sqlstmt).Tables(0) Dim l_dgts As New DataGridTableStyle l_dgts.MappingName = "DataSet" Dim l_aCol1 As New DataGridTextBoxColumn Dim l_aCol2 As New DataGridTextBoxColumn Dim l_aCol3 As New DataGridTextBoxColumn Dim l_aCol4 As New DataGridTextBoxColumn Dim l_aCol5 As New DataGridTextBoxColumn With l_aCol1 .MappingName = "GRNNum" .HeaderText = "GRNNo" .Width = 43 End With With l_aCol2 .MappingName = "GRNDate" .HeaderText = "Date" .Width = 65 End With With l_aCol4 .MappingName = "Name" .HeaderText = "Name" .Width = 85 End With With l_dgts.GridColumnStyles .Add(l_aCol1) .Add(l_aCol2) .Add(l_aCol4) End With If Not DataGrid1.TableStyles.Count > 0 Then DataGrid1.TableStyles.Add(l_dgts) End If