How to add extra field(In stock/Out of stock) to a DropDownList ?

Discussion in 'ASP .Net' started by savvy, Jun 28, 2006.

  1. savvy

    savvy Guest

    I am developing a Garments shopping cart. On the single product page
    where the customer selects size and colour of a garment and if its ok
    for him, then adds to his basket, so every time he checks for Colour
    (dropdownlist) and Size (dropdownlist) I'm checking whether the Item is
    "In Stock" or "Out of Stock" and displaying the same using a Label
    outside.

    Is their any way so that I can display "In Stock" or "Out of Stock"
    inside the dropdownlist menu of the Size when the customer chooses a
    Colour. The pattern wanted is displayed below.

    Colour DropdownList
    Black
    Blue
    Green

    Size DropdownList
    3 yrs (In Stock)
    6 yrs (Out of Stock)
    12 yrs (In Stock)

    I have no idea how to add an extra field inside the DropdownList.
    Any ideas would be of great help to me and will be greatly appreciated
    Thanks in Advance for your time

    Database Queries:
    SELECT * FROM ProductClrIcons WHERE ProductID=@prod_id -- (For
    ColourIcons)
    SELECT * FROM ProductSizes WHERE ProductID=@prod_id--- (For Sizes)
    SELECT * FROM ProductSizesColours WHERE ColourName=@colname AND
    Sizes=@sizes AND ProductID=@prod_id--- ( For StockLevels)
     
    savvy, Jun 28, 2006
    #1
    1. Advertising

  2. PUll the data the way you like it up front

    SELECT ps.ProductSizeID
    , [Description] -- raw description
    , InStock -- raw Boolean for in stock?
    , CASE InStock WHEN 0 THEN Description + ' (Out of Stock)'
    ELSE Description + ' (In Stock)' END As DropDownItem
    FORM ProductSizes
    WHERE ProductID = @ProductID

    You then bind the display field to the concatenated field.

    You will still have to do a server side check when the order is processed,
    but this alerts the customer up front without the check each change.

    If you are bleeding edge, you can also have the check done via Ajax. Okay,
    let's drop that idea for now. :)

    --
    Gregory A. Beamer

    *************************************************
    Think Outside the Box!
    *************************************************
    "savvy" <> wrote in message
    news:...
    >I am developing a Garments shopping cart. On the single product page
    > where the customer selects size and colour of a garment and if its ok
    > for him, then adds to his basket, so every time he checks for Colour
    > (dropdownlist) and Size (dropdownlist) I'm checking whether the Item is
    > "In Stock" or "Out of Stock" and displaying the same using a Label
    > outside.
    >
    > Is their any way so that I can display "In Stock" or "Out of Stock"
    > inside the dropdownlist menu of the Size when the customer chooses a
    > Colour. The pattern wanted is displayed below.
    >
    > Colour DropdownList
    > Black
    > Blue
    > Green
    >
    > Size DropdownList
    > 3 yrs (In Stock)
    > 6 yrs (Out of Stock)
    > 12 yrs (In Stock)
    >
    > I have no idea how to add an extra field inside the DropdownList.
    > Any ideas would be of great help to me and will be greatly appreciated
    > Thanks in Advance for your time
    >
    > Database Queries:
    > SELECT * FROM ProductClrIcons WHERE ProductID=@prod_id -- (For
    > ColourIcons)
    > SELECT * FROM ProductSizes WHERE ProductID=@prod_id--- (For Sizes)
    > SELECT * FROM ProductSizesColours WHERE ColourName=@colname AND
    > Sizes=@sizes AND ProductID=@prod_id--- ( For StockLevels)
    >
     
    Cowboy \(Gregory A. Beamer\), Jun 28, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piotrek \Alchemik\

    DropDownList from database and extra field

    Piotrek \Alchemik\, Sep 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    408
    Mark Rae
    Sep 7, 2006
  2. parvathi
    Replies:
    0
    Views:
    453
    parvathi
    Feb 3, 2009
  3. mathieu
    Replies:
    3
    Views:
    641
    Bo Persson
    Sep 4, 2009
  4. Santhu

    How to add extra property to DropDownList control?

    Santhu, Jan 16, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    200
    Branimir Giurov
    Jan 18, 2004
  5. Sound
    Replies:
    2
    Views:
    498
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page