First of all there has been questions ( DropDownList has a SelectedValue which is invalid because it does not exist in the list of items , DropDownList "has a SelectedValue
Why do I get the exception.
After Page_Init() is called, ddlTest has been bound to 3 items: "1", "2" and "3". You then set the SelectedValue to "3" and manipulate all sorts of things related to the DropDownList control. But the control is still bound to the previous list -- you haven't called .DataBind() again even though you've changed the DropDownList properties. The exception occurs because the control is still bound to the {1, 2, 3}, it's hanging on to the previous .SelectedValue and you've just tried to .DataBind() it to a list that does not include "3".