Hi all,
I want to create a custom UserControl that embed a DataGridView (and more). Once I have drag-dropped my custom control on a Form and apply a DataSource to my custom control, I want that the designer auto-generate the
columns and finally be abble to manage them with the ColumnsEditor from the designer.
1 - I have added the DataSource and DataMember properties to my custom
control and set the property (AttributeProvider, Editor) and class
(ComplexBinding) attributes
2 - I have created a class that inherits from CodeDomSerializer, overrides
the Serialize method and set the class attribute (DesignerSerializer).
I created a new Form, add my custom control on this form, affect a
DataSource and the columns where generated. So everything seems to be fine
but...
1 - The code is well generated into the Designer.vb class but the columns generated are Variables instead of Members and the values that I set to my columns are on top of the BeginInit and SuspendLayout call, but all the comments I set are at the right place in the code (?)
2 - When I close the Form, re-open it and modify anything on the form, it
seems that the previous code generated is "translated" and I find the usual
code at the rigth place and the custom serializer is called again (twice)to generate (again)
the wrongcode. So I have duplicate columns declaration into my designer.vb and the designer bangs of course 
When I debug the design-time, in the Serialize method, I can see that the
manager.RecycleInstances is set to False,is maybe it the problem ? but i can't set it to True :/
Please HEEELPPPP 
Thierry