The following code checks the current mode, and if it's "Edit" mode, finds the dropdownlist control and selects the option with the value in the DataItem: