That got me close but I'm still having problems. Here is what I'm trying:try to use datagridtablestyle.
When I try to run this I get an error on colStyle.Width = 0:VB Code:
Dim tableStyle As New DataGridTableStyle Dim colStyle As DataGridColumnStyle daClass.Fill(ds, "Classes") daHull.Fill(ds, "Hulls") ds.Relations.Add("ClassRel", _ ds.Tables("Classes").Columns("classId"), _ ds.Tables("Hulls").Columns("classId")) Me.dgHulls.SetBindings(ds,Classes.ClassRel") tableStyle.MappingName = "Classes.ClassRel" Me.dgHulls.TableStyles.Add(tableStyle) colStyle = tableStyle.GridColumnStyles.Item("classId") 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?




Reply With Quote