I am having a nightmare with this, i really hate using gridviews.
Anyway, basically i have a dropdown list in a gridview, which i want to bind to a datasource and populate it from codebehind (this allows me to populate it from a file listing).
I have tried to populate the list in just about all the gridview events, rowupdating, databound etc but as soon as i hit edit in the gridview i get an error stating the selectedvalue does not exist - thats because it is trying to set the selectedvalue (needed to bind it) before i can populate it.
I click on the gridview edit button, which event do i use to populate the dropdown - without getting the
"SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value"
god this should be so simple.