In that case, you will need to save old selected values in some hidden control and re-selcect the value using something like:
if (this.cboCustomer.Items.FindByValue(lcOldValue) != null)
{
this.cboCustomer.SelectedItem.Selected = false;
this.cboCustomer.Items.FindByValue(lcOldValue).Selected = true;
}
>Ok, I'll bite. How do I set DropDownList.AutoPostBack property to false when it's down, yet still have it fuction in a postback situation (50% of the time I need it).
>
>
>
>>.NET controls have a thing called ViewState. It takes care of repopulating DropDown values and last selected values. You probably redefining all dropdowns on postback too and that is why they reset.
>>
>>
>>private void Page_Load()
>>{
>> if (!this.IsPostBack)
>> {
>> //Code that defines the dropdown
>> }
>>}
>>
>>
>>>Second, when the list is exposed, how do I allow keystrokes to be used? A to Z as well as Arrows Up and Down?
>>
>>Set DropDownList.AutoPostBack property to false.
>>
>>>I have a bunch of drop down lists. One has 500 items, most have around 50 or less. Anyway, how do I keep the item SELECTED in view on a postback?
>>>
>>>Second, when the list is exposed, how do I allow keystrokes to be used? A to Z as well as Arrows Up and Down?
>>>
>>>TIA
>>>
>>>__Stephen
- Jayesh