473,396 Members | 1,671 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,396 software developers and data experts.

Caricare ComboBox

Ciao a tutti,

ho un problema probabilmente banale ma che non riesco a risolvere

per caricare in modo statico una combobox di un valore chiave e un
valore che venga visualizzato

utilizzo il metodo:

combo.Items.Add

non mi consente però di aggiungere una chiave che potrei richiamare
come combo.ValueMember

come posso fare ?

in html il corrispettivo è

<select name="combo">
<option value="chiave">valore visualizzato</option>
...............

Grazie

Nov 28 '06 #1
3 6357
Hi NowSeeSharp,

prova questo:

DropDownList1.Items.Add (nuovo ListItem (“uno„, “1„));
DropDownList1.Items.Add (nuovo ListItem (“due„, “2„));
DropDownList1.Items.Add (nuovo ListItem (“tre„, “3„));

BTW, se usate l'inglese, che penso sono richiesto, otterrete le risposte più
rapide.

Joe
--
http://www.csharp-station.com
"NowSeeSharp" wrote:
Ciao a tutti,

ho un problema probabilmente banale ma che non riesco a risolvere

per caricare in modo statico una combobox di un valore chiave e un
valore che venga visualizzato

utilizzo il metodo:

combo.Items.Add

non mi consente però di aggiungere una chiave che potrei richiamare
come combo.ValueMember

come posso fare ?

in html il corrispettivo è

<select name="combo">
<option value="chiave">valore visualizzato</option>
...............

Grazie

Nov 28 '06 #2
Anche chi sono delle grupi in italiano:

microsoft.public.it.dotnet

e

microsoft.public.it.dotnet.csharp

Joe Mayo (C# MVP) wrote:
Hi NowSeeSharp,

prova questo:

DropDownList1.Items.Add (nuovo ListItem ("uno,,, "1,,));
DropDownList1.Items.Add (nuovo ListItem ("due,,, "2,,));
DropDownList1.Items.Add (nuovo ListItem ("tre,,, "3,,));

BTW, se usate l'inglese, che penso sono richiesto, otterrete le risposte più
rapide.

Joe
--
http://www.csharp-station.com
"NowSeeSharp" wrote:
Ciao a tutti,

ho un problema probabilmente banale ma che non riesco a risolvere

per caricare in modo statico una combobox di un valore chiave e un
valore che venga visualizzato

utilizzo il metodo:

combo.Items.Add

non mi consente però di aggiungere una chiave che potrei richiamare
come combo.ValueMember

come posso fare ?

in html il corrispettivo è

<select name="combo">
<option value="chiave">valore visualizzato</option>
...............

Grazie
Nov 28 '06 #3
Did not understand even single line... :-)

Thanks
-Srinivas.
NowSeeSharp wrote:
Ciao a tutti,

ho un problema probabilmente banale ma che non riesco a risolvere

per caricare in modo statico una combobox di un valore chiave e un
valore che venga visualizzato

utilizzo il metodo:

combo.Items.Add

non mi consente però di aggiungere una chiave che potrei richiamare
come combo.ValueMember

come posso fare ?

in html il corrispettivo è

<select name="combo">
<option value="chiave">valore visualizzato</option>
...............

Grazie
Dec 4 '06 #4

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

Similar topics

13
by: Mr. B | last post by:
Here's the situation... You've a combobox with Items already added. Say they look like this (or even lines of text): 10-00-232 10-00-256 10-01-006 10-01-213 10-02-200
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matiæ | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
1
by: Alex | last post by:
Ciao a tutti, sto sviluppando un applicazione windows, in breve all'interno dello stesso namespace ho un form con una datagrid e un thread che effettua dei controlli e "dovrebbe" caricare i dati...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.