Wrox Programmer Forums
|
BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9
This is the forum to discuss the Wrox book Professional ASP.NET 3.5: In C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470187579
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2008, 11:16 AM
Registered User
 
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to hughworm
Default 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

The Following User Says Thank You to hughworm For This Useful Post:
tasmin96 (February 14th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList in Gridview sdoremus ASP.NET 3.5 Basics 0 September 15th, 2008 07:15 PM
Gridview and DropDownList extendedram ASP.NET 2.0 Basics 3 June 12th, 2007 04:05 PM
Need to get value of gridview template columns for kmh030 ASP.NET 2.0 Professional 1 January 6th, 2007 11:10 PM
Gridview manual databinding through code thas123 ASP.NET 2.0 Basics 3 December 12th, 2006 01:18 PM
Gridview and dropdownlist GuyB ASP.NET 1.0 and 1.1 Basics 0 November 9th, 2006 08:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.