I know how to set the ddl.selectedindex = x. That is not the problem.
I have a dynamically populated DropDownList populated from a database.
I use the onitemdatabound to populate the list when the edit link is
clicked. What I want it to do is put the dropdownlist's selectedindex
at the value it was at when the user first entered data.
So, for example, the ddl has:
smith
jones
johnson
the user clicked jones when they first entered the data, but now, the
hit edit. I don't want the ddl to be put back at smith. I want the
list to start at jones (the list is the same; I just mean what is
displayed as the selectedindex).
I just cannot figure out where to set it.
I have my onitemdatabound event that populates it, but when I tried to
read the current selected index just before I populate it, it is too
late. I get -1; something has changed and I don't know where to get
the current selectedindex value that was there when edit was clicked.
Thank you for any help.