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...
|