Temmu,
the code is to much complex to be posted here
The DropDownList is placed between the start and the end tag of my control,
in the aspx, something like
<cc1:mycontrol ...>
<asp:dropdownlist ...>
</cc1:mycontrol>
The DropDownList is being populated in Page_Load inside the "if NOT
Postback" block ...
To try to track where and when the ViewState of the DropDownList is lost
I've done the following
1. Created MyDropDownList by simply inheriting from DropDownList
2. Overrided the SaveViewState, just to be able to see if Items are saved in
the view state
3. Break Point placed at the end of the overridden SaveViewState gives the
following info:
a) Items property has 4 items I've added in the Page_Load, BUT
b) the Second parameter of the ViewState Triplet is empty!
I've then placed MyDropDownList directly on the Page, ... checked the saved
ViewState ... the "Second" parameter of the Triplet inside the ViewState
holds my items!
Summary: for some unknown reason the ViewState of the DropDownList is not
"populated" with the Items property, when the DropDownList is placed in my
custom control.
p.s.
Thank you for answering, I hope the above helps.
~Zarko