Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How do I display this information?

Reply
Thread Tools

How do I display this information?

 
 
M K
Guest
Posts: n/a
 
      06-04-2004
Okay, I have a ShoppingCartDetails table. The shopping cart lists photographic prints. There may be one image with more than one line item, or more than one print size. For example

CartDetailID ProductID Qty PhotoID..
1 5x7 2 000
2 4x5 4 000

Now, there may also be a line item for a product that requires more than one image. In which case, those images are in a second table, linked by the CartDetailID

CartDetailID ProductID Qty PhotoID..
3 PhotoCube 2

AddPhotoID CartDetailID PhotoID..
1 3 000
2 3 000
3 3 000
4 3 000
5 3 000

So I'd like my datagrid to do something like this

Photo Products Qty Tota
--------------------------------------
0003 5x7 2 $2.9
4x5 4 $3.7
--------------------------------------
0004 PhotoCube 2 $12.9
000
000
000
000

Am I nuts? Any ideas? I could probably do two queries, one for line items with a PhotoID and then group the Products by that PhotoID (DataView or something) and another query for line items without a PhotoID which would then get a group of PhotoIDs from the second table. But I wanted to know if there was anybody with a good idea.
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      06-04-2004
That sounds like a job for Denis Bauer's free HierarGrid!

"I have created a custom control called HierarGrid that derives from the
DataGrid and a custom DataGridColumn called HierarColumn.

The HierarGrid takes a DataSet that contains relations between the tables.

While iterating over the parent table it checks the related tables for child
rows and if one is found it dynamically loads a template for the child
row(s).

The template is rendered invisibly into the custom HierarColumn and when the
user clicks the plus icon, the template content is copied via JavaScript
into a newly created TableRow."


http://www.denisbauer.com/ASPNETCont...ierarGrid.aspx


"M K" <> wrote in message
news:52432EDB-96F0-4881-97B4-...
> Okay, I have a ShoppingCartDetails table. The shopping cart lists
> photographic prints. There may be one image with more than one line item,
> or more than one print size. For example:
>
> CartDetailID ProductID Qty PhotoID...
> 1 5x7 2 0003
> 2 4x5 4 0003
>
> Now, there may also be a line item for a product that requires more than
> one image. In which case, those images are in a second table, linked by
> the CartDetailID:
>
> CartDetailID ProductID Qty PhotoID...
> 3 PhotoCube 2
>
> AddPhotoID CartDetailID PhotoID...
> 1 3 0004
> 2 3 0005
> 3 3 0006
> 4 3 0007
> 5 3 0008
>
> So I'd like my datagrid to do something like this:
>
> Photo Products Qty Total
> ---------------------------------------
> 0003 5x7 2 $2.99
> 4x5 4 $3.75
> ---------------------------------------
> 0004 PhotoCube 2 $12.99
> 0005
> 0006
> 0007
> 0008
>
> Am I nuts? Any ideas? I could probably do two queries, one for line items
> with a PhotoID and then group the Products by that PhotoID (DataView or
> something) and another query for line items without a PhotoID which would
> then get a group of PhotoIDs from the second table. But I wanted to know
> if there was anybody with a good idea.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Display byte array back to pdf and display in IE SG Java 6 01-15-2008 01:02 PM
choosing to display or not to display a checkbox in repeater control. Imran Aziz ASP .Net 4 08-11-2005 05:00 PM
Double double display display problem problem Tom Accuosti Firefox 3 09-27-2004 10:02 PM
Display and display model Marc Twain Java 1 01-13-2004 07:05 PM



Advertisments