Databinding DropDownList in gridview template
Great book, but this is a bit of a gripe about chapter 7.
The example of databinding a DropDownList in the EditItemTemplate of the grid view (pages 339-341) uses acres of ugly code doing the databinding manually. And it didn't seem to support optimistic locking.
Well I've finally realised it doesn't need to be like that. By adding
SelectedValue='<%# Bind("ContactTitle") %>'
to the DropDownList definition all that ugly code goes in the bin and it seems to work perfectly.
Thank goodness! Apologies I missed it, but wouldn't it be an idea to mention it in the book?
Cheers,
HuW
|