G
Guest
I have a formview with a few dropdownlists (software version, database
version, etc). When a software version is selected, the database version
dropdownlist updates itself accordingly. When in edit mode, everything works
fine - the selected value in each list defaults to the value from the
database record (selectedvalue=bind...).
However, in insert mode (insertitem), it is not working. I pass in a value
on the query string that I would like as the default selected software. The
selected value is set (all debugging shows that it is set) correctly and the
database dropdownlist is populated correctly according to that software, but
the value that is actually displayed in the software dropdown is NOT the
selectedvalue i set - it's the first item in the list - which doesn't match
the correctly populated database dropdown.
I've put a button on the page that sets the selected value to, for example
"3", when clicked. After the page loads I click on the button and it changes
just fine. Also, I've tried changing the code so that whether you are
editing or inserting, the code is always executed the same, but the dropdown
still seems to default to the first item when using the insertitem template.
Is there perhaps something about the insertitemtemplate that, no matter what
you may specify in onLoad, sets all the drop downs to default to the first
item? If that's the case, can I change it? Or am I missing something else?
Any and all help would be greatly appreciated.
Ben
version, etc). When a software version is selected, the database version
dropdownlist updates itself accordingly. When in edit mode, everything works
fine - the selected value in each list defaults to the value from the
database record (selectedvalue=bind...).
However, in insert mode (insertitem), it is not working. I pass in a value
on the query string that I would like as the default selected software. The
selected value is set (all debugging shows that it is set) correctly and the
database dropdownlist is populated correctly according to that software, but
the value that is actually displayed in the software dropdown is NOT the
selectedvalue i set - it's the first item in the list - which doesn't match
the correctly populated database dropdown.
I've put a button on the page that sets the selected value to, for example
"3", when clicked. After the page loads I click on the button and it changes
just fine. Also, I've tried changing the code so that whether you are
editing or inserting, the code is always executed the same, but the dropdown
still seems to default to the first item when using the insertitem template.
Is there perhaps something about the insertitemtemplate that, no matter what
you may specify in onLoad, sets all the drop downs to default to the first
item? If that's the case, can I change it? Or am I missing something else?
Any and all help would be greatly appreciated.
Ben