G
Guest
I have a UserControl that contains a DataGrid control. The UserControl
exposes the TableStyles property of the constituent DataGrid to the outside
world
Public ReadOnly Property TableStyles() As
Windows.Forms.GridTableStylesCollection
Get
Return Me.Grid.TableStyles
End Get
End Property
When the UserControl is dropped onto a form the designer allows you to add
and modify the table styles through the table style editor just like it were
an ordinary DataGrid. and all of the code for the TableStyle,
CollumnHeaderStyles etc.. are added to the initialise component method of the
form as would be expected. However the line that should read
Me.NewDataGrid.TableStyles.AddRange(New
System.Windows.Forms.DataGridTableStyle() {Me.DataGridTableStyle1})
is not added to the code in initialise component. So, when you close the
table style editor the table style is not associated with the control as it
would be if it were an ordinary DataGrid. Adding the above line manually
after initialise component means that at runtime the table styles will apply,
but I cannot easily use the designer as I would like.
What am I missing please.
exposes the TableStyles property of the constituent DataGrid to the outside
world
Public ReadOnly Property TableStyles() As
Windows.Forms.GridTableStylesCollection
Get
Return Me.Grid.TableStyles
End Get
End Property
When the UserControl is dropped onto a form the designer allows you to add
and modify the table styles through the table style editor just like it were
an ordinary DataGrid. and all of the code for the TableStyle,
CollumnHeaderStyles etc.. are added to the initialise component method of the
form as would be expected. However the line that should read
Me.NewDataGrid.TableStyles.AddRange(New
System.Windows.Forms.DataGridTableStyle() {Me.DataGridTableStyle1})
is not added to the code in initialise component. So, when you close the
table style editor the table style is not associated with the control as it
would be if it were an ordinary DataGrid. Adding the above line manually
after initialise component means that at runtime the table styles will apply,
but I cannot easily use the designer as I would like.
What am I missing please.