tfowler Posted June 20, 2006 Posted June 20, 2006 I'm having some problems with a DropDownList in a DetailsView. I am populating the list at run-time based on other selections by the user. It works great until I select a row in the corresponding GridView to edit. I then get the error: "System.ArgumentOutOfRangeException: 'ddlTableColumn' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value". My guess is that this error occurs because the DropDownList is not yet populated before the edited row is binded to it. I am currently populating the DropDownList in the Page_PreRenderComplete event. I have also tried placing it in the DetailsView PreRender event, which has the same effect. Placing it in the DetailsView DataBinding or Load events results in an empty DropDownList control. My question is, where should I populate the DropDownList so that it gets loaded properly, and is available for binding the edited row? After 3 days of messing with this and searching the web for answers, I am getting extremely frustrated! :( This should be simple enough. Todd Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.