Author: houghtp | Posted on: 5/11/2010 3:40:58 PM | Views : 440

Hi I hope someone can help,
I have a detailsview with template fields.  when i go into edit mode i am trying to set the selectedvalue of a dropdownlist to be the value of the corresponding label from the item template in code behind as once i go into edit mode i loose the initial value from the detailsview and the dropdownlist defaults to the first listitem.  what i am doing is onDataBinding of the detailsview i access the cell value of the label , i then assign that to a public variable but once i've exited the routine the public variable looses the value of the detailsview cell i've just assigned to it.  this is the value i'm hoping to assign to the selectedvalue of the dropdownlist when i go into editmode.  The reason i'm doing it this way is although i can use bind in the html to mantain the dropdownlist selected value between detailsview states once i come to update the detailview i get the following error 
< ...

Go to the complete details ...