Hi all,
I have a small problem that I hope someone can explain to me...
I load an ListArray with ListItems to 2 different DropDownLists in my
PageLoad method. Then I select 2 different indexes in the 2 DropDownLists -
but when the page displays it is the same Item selected in both
DropDownLists....why?
Here some code example:
// loads list from db
for(IEnumerator ienum = this.GetList().GetEnumerator();ienum.MoveNext();)
{
ListItem li = (ListItem)ienum.Current;
this.ddl1.Items.Add(li);
this.ddl2.Items.Add(li);
}
this.ddl1.SelectedIndex = 1;
this.ddl2.SelectedIndex = 4;
And if I do like this it works fine:
for(IEnumerator ienum = this.GetList().GetEnumerator();ienum.MoveNext();)
{
ListItem li = (ListItem)ienum.Current;
this.ddl1.Items.Add(li);
}
for(IEnumerator ienum = this.GetList().GetEnumerator();ienum.MoveNext();)
{
ListItem li = (ListItem)ienum.Current;
this.ddl2.Items.Add(li);
}
this.ddl1.SelectedIndex = 1;
this.ddl2.SelectedIndex = 4;
Plz....can anyone explain this....??
//Anders =)