First off, if you are pre-selecting values at
SelectedIndexChanged
event of
DropDownList
, then you need to set
AutoPostback
to TRUE to trigger the
SelectedIndexChanged
event.
Second, if you are binding and doing the pre-selection at
Page_Load
event, then make sure you wrap your code within
!IsPostback
block.
Third, try to do something like this to pre-select value based from the data in your database:
ListItem item = ddlSL5.Items.FindByValue(dataTable.Rows[0]["Value5"].ToString());
if (item != null){
ddlSL5.ClearSelection();
item.Selected = true;
}
Do the same for the rest of your
DropDownLists
.