Hi, I have some HtmlSelect (a'la asp.net's DropDownList) with ID's like Select1, Select2, ..., Select13. I create the static List of items:
for (int i = 0; i < tab.Length; i++)
_listItems[i] = (new ListItem { Text = tab[0, i], Value = tab[1, i], Selected=false });
then I assign that list for each HtmlSelect control & assign a new SelectedIndex property:
var HtmlSelectControl = ((HtmlSelect)this.FindControl(String.Format("Select{0}", controlNumber)));
HtmlSelectControl.Items.AddRange(_listItems);
HtmlSelectControl.SelectedIndex = controlNumber - 1;
The problem is, when I set the SelectedIndex property of the Select2 control (e.g. =1), the Select1 control has the same SelectedIndex property (which has that index =0). Why ?