An old friend of mine, Joe Shook, laughingly said, you should read what other people write too once in a while. Of course, he was right and naturally I do. I read almost everything I can get in my hands including technical books, blogs, and articles because I am surprised by the number of things I haven't mastered or that I still don't have a best practices sort of solution for. Thankfully I am still willing to stay up to 11 or 12 o'clockused to be until the next morningworking out the details of what I don't know until I am happy with an answer.
This article provides a comprehensive solution for defining an edit template in a Form View. The Form View is a binding control like the Grid View, except where the Grid View shows multiple rows of data and the Form View shows one record at a time in a form layout.
The edit template contains a Drop Down List and the population, binding, and updating is all handled declaratively. After you complete the data source wizard the Form View will have controls added to it for the Item Template, Edit Item Template, and Insert Item Template.
It is the Edit Item Template you are interested in.
I couldn’t for the life of me figure out why the Form View kept re-initializing the data even though I didn’t actually save anything to the DB in the BLL.
Well, it turns out that my approach of returning an envelope just wasn’t cutting it.