HI all,
Please help me with this:
I have a form which contains my custom control.
In the custom control, I have 2 collections referencing to the same DataSource to get data.
My current CodeDOM serializer working like this:
control1.Values.DataSource = new objA();
control1.CategoryNames.DataSource = new objA();
As you can see, the objA was instantiated 2 time.
How to solve this?
I guess I can declare a variable that hold reference to the objA, then assign that variable to 2 collections:
ObjA var = new objA();
control1.Values.DataSource = var;
control1.CategoryNames.DataSource = var;
But I cannnot ensure the "var" is an unique name. How can I get it automatically assigned exactly the name Form gave to my control (control1, control2 and so on)?
Thank you.