Multiple Datagrids (Need Help)

Results 1 to 2 of 2

Thread: Multiple Datagrids (Need Help)

  1. #1
    Join Date
    Dec 1969

    Default Multiple Datagrids (Need Help)

    Hi Guys, <BR><BR>I have a products listing aspx page. The Products db table stores various product information, where as the product&#039;s size and the price are stored in another table named Catalog. Now, one product can have multiple size/price combinations or can have just 1 size/price. On the listing page, I am displaying the product information in a Datagrid and on OnItemDataBound event, I&#039;m creating another datagrid at runtime with the product&#039;s size/price information. If a product has more than 1 size/price combination then I am displaying a checkbox in this grid. This inner grid is now added to one of the columns of the outer grid. The last column of the outer grid has a "Buy Now" button. <BR><BR>My problem is: how do I add products to the user&#039;s shopping cart? The listing is something like this: <BR><BR>ProductID Product Name Description Size/Price <BR><BR>ABCD1 ProdName1 ProdDesc1 10ml - $50 [ ] <BR> 50ml - $100 [ ] "BUY NOW" <BR> 75ml - $150 [ ] <BR><BR>ABCD2 ProdName2 ProdDesc2 10ml - $20 [ ] <BR> 50ml - $75 [ ] "BUY NOW" <BR> 75ml - $125 [ ] <BR><BR>ABCD3 ProdName3 ProdDesc3 10ml - $150 "BUY NOW" <BR><BR>ABCD4 ProdName4 ProdDesc4 75ml - $350 "BUY NOW" <BR><BR>Please remember that the Size/Price values are displayed in another grid that is being created at runtime for each row of the parent grid. Each product is identified by the ProductID. When the user clicks the "Buy" button for a product having multiple size/price values, then only the checked products should added to the cart. For other products having single size/price value clicking the "Buy" button should add that product only. <BR><BR>Your help will be appreciated. Thanks. <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Multiple Datagrids (Need Help)

    Hi. .<BR> this is an interesting problem..<BR>I have a solution which you have to try..<BR> At that items cell.. <BR>1. u can use HasControls method to find if there are any child controls<BR>2. GetType method to find if there is a Grid<BR>3. If there is another grid.. u can use a loop with FindControl method to achieve the checked products.<BR><BR>will this help to solve ur prob ?<BR>Let me know ! of it !<BR><BR>Happy programming !<BR>Sri !<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts