Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a User Control that inherits from a DataGridView, it has a Sub that builds the columns for it called BuildColumns() inside the Sub New().

When i drag it on to the form in Design it builds the columns and i can remove or edit them in the Edit Columns or Columns Collection, but of course in Run Time they get overwritten by BuildColumns() being called again, i wondered how i could send back the Column Collection from design time to the User Control for Run Time?

What I have tried:

Booleans to to trigger when i edit columns but they don't work, probably missing something. No idea
Posted
Updated 13-Jul-17 9:24am
v3
Comments
Ralf Meier 14-Jul-17 4:22am    
I suppose that the Columns are not serialized from the Designer because they are not part of your controls properties.

Provide your code and we could look what exactly is missing ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900