Wrox Programmer Forums
|
BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5
This is the forum to discuss the Wrox book Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit by David Sussman, Alex Homer; ISBN: 9780764588075
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 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 March 2nd, 2006, 06:07 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Orders Page with GridView

I have reworked the Orders.aspx page to use a GridView to display the menu instead of a DataList with nested repeater. However, now the Orders page will not interact with the StoredShoppingCart class.

I've chased down the problem in the codefile and it relates directly to master/detail display in the initial implementation. Originally, you have to use FindControl() method to extract out the ItemID and ItemName from the nested Repeater while grabbing the ItemSize and ItemPrice from the DataList. So you basically have 2 controls each supplying 2 parameters.

Now however, I have one control and can only expose 2 parameters for processing by using the GridView's CommandName and CommandArgument properties. I kindof see this as a "hack" to deliver information to the codebehind file for processing but who knows... i'm still a rookie.

So basically the problem here is that when you decide to use a GridView to display data, you will be limited to being able to only send 2 parameters to an event for processing via the CommandName and CommandArgument properties. What if you need to expose more data to the event for processing? There must be a more direct approach to locating bound data within a gridview since it is one of ASP.NET 2.0's most useful controls...


 
Old March 3rd, 2006, 07:36 AM
Authorized User
 
Join Date: Jan 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would suggest that you use the feature of the GridView where you can selected a row. In the event handler, you can then get a reference to the row and extract the contents of any column in that row. You can add hidden controls to the row in the SelectedItemTemplate and populate these with values from the source data, then grab the contents in your event handler. Is that any help?





Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView and page size snufse ASP.NET 2.0 Basics 1 January 11th, 2008 08:54 AM
Chapter 7 Orders File stabor BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 5 September 10th, 2007 09:25 AM
Counting unique orders rlull SQL Server 2000 1 November 12th, 2005 12:34 AM
PHP and SQL orders Ashleek007 PHP How-To 2 November 7th, 2004 08:27 AM





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