views:

80

answers:

1

Here's the problem I'm having in my asp project.

My shopping cart consists of 3 classes like the picture below.

The class Carrinho has a List of Arranjo wich by itself has a List of Product.

Now I want to display the Carrinho's list and I have a GridView whose data source is an ObjectDataSource that's associated to the Carrinho object. It should display, for now, just the Total property from Arranjo but I keep getting an empty page always. I have debugged the project and the list is definitely not empty.

What am I doing wrong?

classes picture

+2  A: 

It's not regular to do that (biding a list of list<object> ) . Any way if you insist to do that you should know you need to bind a list of object to each item in GridView Row , So that item should be like List controls . otherwise you should convert your field to "ItemTemplate" and you bind by your own . Here is a good example


Hope that helps

Mostafa
Just to clarify a little bit more...it's a web Flower Shop.A client can choose various bouquets and each bouquet has many flowers. That's why I have a list of list. Each cart has X bouquets with Y flowers.
Joao Heleno
You can Convert you column in GridView into ItemTemplate and put some ListControls like BulletList then you should bind them by you own
Mostafa