hello rex, here is a bit of code that should help. you can also assign the width in design mode by going to the properties of the datagrid and adding a tablestyle the collection and then by adding columns collections to the tablestyle. hope this helps.
Private Sub AddCustomDataStyle()
Dim Ts1 As New DataGridTableStyle()
Ts1.MappingName = "Employee"
Dim grdColStyleA As New DataGridTextBoxColumn()
grdColStyleA.Width = 0
grdColStyleA.MappingName = "EmployeeID"
grdColStyleA.HeaderText = "ID"
Ts1.GridColumnStyles.Add(grdColStyleA)
grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 152
grdColStyleA.MappingName = "strEmployeeName"
grdColStyleA.HeaderText = "Employee Name"
Ts1.GridColumnStyles.Add(grdColStyleA)
grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 75
grdColStyleA.MappingName = "strEmployeeNumber"
grdColStyleA.HeaderText = "Emp. Number"
Ts1.GridColumnStyles.Add(grdColStyleA)
grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 75
grdColStyleA.MappingName = "strEmployeeCode"
grdColStyleA.HeaderText = "Emp. Code"
Ts1.GridColumnStyles.Add(grdColStyleA)
grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 86
grdColStyleA.MappingName = "strEmployeePassword"
grdColStyleA.HeaderText = "Password"
Ts1.GridColumnStyles.Add(grdColStyleA)
Me.DataGrid1.TableStyles.Add(Ts1)
End Sub
Randy Belcher
AFG Industries, Inc.