Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to add extra field(In stock/Out of stock) to a DropDownList ?

Reply
Thread Tools

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

 
 
savvy
Guest
Posts: n/a
 
      06-28-2006
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)

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      06-28-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>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)
>



 
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
Does return-by-value mean extra copies and extra overhead? mathieu C++ 3 09-04-2009 04:25 PM
DataBound dropdownlist + extra Item =?Utf-8?B?ZGhucml2ZXJzaWRl?= ASP .Net 4 07-25-2005 12:25 PM
DropDownList SelectedIndexChanged not firing for extra <form> =?Utf-8?B?R2Vvcmdl?= ASP .Net 4 09-08-2004 02:23 PM
How to add extra property to DropDownList control? Santhu ASP .Net Building Controls 1 01-18-2004 10:05 PM



Advertisments