Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DropDown loosing selectedindex when hidden.

Status
Not open for further replies.

Chopsaki

Programmer
Nov 21, 2001
85
US
Hello.
I have a page. It has a hidden panel on it. The panel contains various
controls, their selections and values are loaded from a dataset (when
hidden). When a user clicks a button the panels visibility is set to
visible. Everything shows up fine, including radio groups and listboxes.
They maintain their proper selectedItem index, however the dropdowns do not.
I cannot find any fixes for this. Does anyone have a fix?

thanks in advance,

foo
 
Most likely, you're re-binding those dropdowns on each load of the page... if you do that, you lose your indexes.

To resolve this, only bind the controls when:

not page.ispostback

paul

penny1.gif
penny1.gif
 
No offence mate but I did say that all the other controls are maintaining their selectedIndex (listboxes). I am well aware of the postback event too. I actually have this problem in about 20-30 usercontrols. I am pretty sure it is a bug.

foo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top