473,434 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

ComboBoxes in vb.net



Hi,
I have Two string arrays and several questions...
I want to populate a combobox with the contents of both of the arrays.

Is there a way, like in classic asp/html, where i can have a value for
the label and one for the actual value. like in a select:-
<option value="val">Value Displayed</option>

I want to display the name from one array and use the corresponding
value from another as the value.
Also, i've noticed that when i add things to a combobox there is no
initially selected value. is it possible to show a different option at
the start?

Thanks
Ryan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 996
this.value & " " & ValueDisplayed???

"Ryan McConnell" <ji********@hotmail.com> wrote in message
news:ez****************@TK2MSFTNGP10.phx.gbl...


Hi,
I have Two string arrays and several questions...
I want to populate a combobox with the contents of both of the arrays.

Is there a way, like in classic asp/html, where i can have a value for
the label and one for the actual value. like in a select:-
<option value="val">Value Displayed</option>

I want to display the name from one array and use the corresponding
value from another as the value.
Also, i've noticed that when i add things to a combobox there is no
initially selected value. is it possible to show a different option at
the start?

Thanks
Ryan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
Cor
Hi Ryan,

You can, but you have you use one array of objects or a datatable for it.

I prefer for that to use a datatable with 2 columns, because it is so easy
to make
You can that do
mycombobox.datasource = mytable
mycombobox.displaymember = mycolumn1
mycombobox.valuemember = mycolmn2

The selectedvalue is set by the mycombobox.selectedindex=y

(If you want a simple example how to make a datatable message that back than
i give it to you)

I hope this helps?

Cor
Hi,
I have Two string arrays and several questions...
I want to populate a combobox with the contents of both of the arrays.

Is there a way, like in classic asp/html, where i can have a value for
the label and one for the actual value. like in a select:-
<option value="val">Value Displayed</option>

I want to display the name from one array and use the corresponding
value from another as the value.
Also, i've noticed that when i add things to a combobox there is no
initially selected value. is it possible to show a different option at
the start?

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kathy | last post by:
In my custom menu one menu item opens a form to add new Makes to TblMakes and another menu item opens a form to add new Models to TblModels. I have a form that has a combobox for Makes and a...
0
by: johnson_cy | last post by:
I am using Access 2000. My main form has a record source of a table (employeeTbl with key of . It is filtering the record results. My subform and mainform have the link child/link master set...
1
by: Craig G | last post by:
for months we have been dabling round looking at various 3rd party comboboxes that allow the user to type text into the combobox as a search mechanism what we've found is that the likes of...
1
by: Marcin Podle¶ny | last post by:
Hi, I've a form with three comboboxes. Each of them contains the same data - all cities in my country. As you see it's a lot of data so it takes a lot of memory. I'd like to use the same...
6
by: Sam | last post by:
Hi, I have a datagrid which has (amongst other stuff) 2 comboboxes columns. So far so good. The trick is that when I select a value in my first column, it must updates the items of the combobox in...
2
by: ashishtarlekar | last post by:
Hi all, I have to add comboboxes in the first row of datagridview for mapping the database fields. For e.g. I have to show Id, FirstName, LastName in each comboboxes in the first row. if i select...
2
by: Matt | last post by:
Hi all, me again! :) I've now got an issue with combo boxes. Basically, I have a number of items that I want a user to pick from a single list. It's basically along the lines of: Fruit 1: ...
3
by: Randy | last post by:
I have a routine that creates a series of comboboxes, each of which is bound to a common dataview. Everything used to work fine, but now, when I change the value of any of the comboboxes, the...
5
by: Anthony Bollinger | last post by:
I have two tables in a master-detail relationship. When I make a selection in one combobox, how do I have it display the values from a second combobox? Each table has a key and a text value for...
2
by: Wingot | last post by:
Hey, I have a view to a database that I have created for Client Maintenance. It has a number of fields, but the important ones are Medical Condition, Bill To, and Country. I have a couple of...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.