Last post Sep 11, 2007 10:36 PM by jshepler
Sep 10, 2007 09:22 AM|maxsoft|LINK
Hi all. I need change the order of controls inner a CustomControls.
For example I've 3 dropdownlist the show YearMonthDay, I like change the order.
I've used the controls.Remove and Controls.insertAt but it works well only the first time, when I submit the lost all items.
Sep 11, 2007 10:36 PM|jshepler|LINK
I think it's because when the page reads in the viewstate and updates the control tree with the values, the controls must be in the same order as when their viewstate was created. I don't know if this is your problem or not, but if you are changing the order
of the controls before their viewstate is restored - that might do what you're seeing.
I'm kinda talkin about my butt on this one, but nobody else has replied to you....
If this is the case, then the answer would be to change the order later on in the control's lifecycle. You should be able to do that in the control's OnLoad(). If not, try OnPreRender().