I have a form view that's complaining that it "must be in insert mode to add a new record" -- but I'm trying to update a record that's already successfully displayed -- having rendered the EditItemTemplate. The data binding seems to be working otherwise, but for some reason the FormView thinks I'm trying to insert, when I'm actually trying to update.
The FormView's default mode is Insert, but in the Load event, I change the mode to Edit depending on the presence of a QueryString field. As far as I can tell, the mode change is successful because the EditItemTemplate renders as expected.
I've tried playing around with the DataKeyNames property of the FormView. I have it set to the name of the parameter from my SqlDataSource's UpdateParameters that is the key field for the update.
I'm pretty confused. Any help appreciated.