try to use datagridtablestyle.
That got me close but I'm still having problems. Here is what I'm trying:
VB Code:
  1. Dim tableStyle As New DataGridTableStyle
  2. Dim colStyle As DataGridColumnStyle
  3.  
  4. daClass.Fill(ds, "Classes")
  5. daHull.Fill(ds, "Hulls")
  6. ds.Relations.Add("ClassRel", _
  7.                         ds.Tables("Classes").Columns("classId"), _
  8.                         ds.Tables("Hulls").Columns("classId"))
  9. Me.dgHulls.SetBindings(ds,Classes.ClassRel")
  10. tableStyle.MappingName = "Classes.ClassRel"
  11. Me.dgHulls.TableStyles.Add(tableStyle)
  12. colStyle = tableStyle.GridColumnStyles.Item("classId")
  13. colStyle.Width = 0
When I try to run this I get an error on colStyle.Width = 0:
Object reference not set to an instance of an object.
The debugger shows that colStyle has a value of "Nothing". Can anyone explain what I'm doing wrong?