Access Style Drop Down
Access Style Drop Down
Access Style Drop Down
Access Style Drop Down
Access Style Drop Down
Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down
Access Style Drop Down Access Style Drop Down
Access Style Drop Down
Go Back  Xtreme Visual Basic Talk > > > Access Style Drop Down


Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2007, 09:02 AM
ManWithNoName ManWithNoName is offline
Freshman
 
Join Date: Jul 2006
Posts: 36
Default Access Style Drop Down


Okay. Venturing on my 1st Web Dev Express Proj (VB.ASP) Not Enjoying it so far, not keen on all this .Net Stuff.

Anyway.

Im porting an app which has it's own style combo class with extra functionality. My current app returns an underlying value when you select an item from the combo.

e.g Select Cat & The DBase ID Of Cat is returned from the combo.

Im thinking of cheating and when I add the string values to the combo I am going to create an array in parrallel which holds the id so I can just reference the array value from the selectedindex.

Ideally. I would like all the values, text string and value in the combo, so when I select something I have the value at the same time

Any Suggestions. If I made sense.

Thanx In Advance...
Reply With Quote
  #2  
Old 06-19-2007, 01:05 PM
MKoslof's Avatar
MKoslofAccess Style Drop Down MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Are you using a standard DropDownList control? If you need to get value/display text members you can use the DataBinding properties of the control

Code:
        DropDownList1.DataTextField = "DisplayValue"
        DropDownList1.DataValueField = "UnderlyingValue"
        DropDownList1.DataSource = "YourDataSet";
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 06-21-2007, 01:52 AM
ManWithNoName ManWithNoName is offline
Freshman
 
Join Date: Jul 2006
Posts: 36
Default

Cheers. Will keep that in mind.

If I wasn't going down the bounding route. What options would you suggest?
Reply With Quote
  #4  
Old 06-21-2007, 12:28 PM
MKoslof's Avatar
MKoslofAccess Style Drop Down MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

if you aren't going to bind the control you are going to have to add a single object to the items collection. There is no reason for you to have a seperate array to hold the "other" half of the values. If you want a key/value pair type situation, you can either bind your control or use a Dictionary or HashTable, which holds your key/value pairs. If the "key" portion is stored in your control, you get the value from your dictionary look up.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #5  
Old 06-22-2007, 02:08 AM
ManWithNoName ManWithNoName is offline
Freshman
 
Join Date: Jul 2006
Posts: 36
Default

Cheers. It's in place now, easier than I first thought.

Get The Records, Then Just Bind It To Table Or Dataview. Then Use The Underlying Value As You Mentioned Above.

Cheers..
Reply With Quote
  #6  
Old 06-28-2007, 09:59 AM
MKoslof's Avatar
MKoslofAccess Style Drop Down MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Sounds good, let us know if you have any other questions
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Access Style Drop Down
Access Style Drop Down
Access Style Drop Down Access Style Drop Down
Access Style Drop Down
Access Style Drop Down
Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down Access Style Drop Down
Access Style Drop Down
Access Style Drop Down
 
Access Style Drop Down
Access Style Drop Down
 
-->