It shows in the select item as
{ListViewItem} : Value
Main Topics
Browse All TopicsIs there a way to set the value of an item within a combo box without using DataBind() ?
We use objects to get to data, where I really can't do anything about it this way.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Your class object must have two different fields. One for the actual text, and one for the value item. Here's an example from MSDN Library
First, we define the class object that we'd use in the combobox
--------
Public Class USState
Private myShortName As String
Private myLongName As String
Public Sub New(ByVal strlongName As String, ByVal strShortName As String)
MyBase.New()
Me.myShortName = strShortName
Me.myLongName = strlongName
End Sub
Public ReadOnly Property ShortName() As String
Get
Return myShortName
End Get
End Property
Public ReadOnly Property LongName() As String
Get
Return myLongName
End Get
End Property
Public Overrides Function ToString() As String
Return Me.ShortName & " - " & Me.LongName
End Function
End Class
--------
Then, we will populate the array collection
Dim USStates As New ArrayList
USStates.Add(New USState("Washington", "WA"))
USStates.Add(New USState("West Virginia", "WV"))
USStates.Add(New USState("Wisconsin", "WI"))
USStates.Add(New USState("Wyoming", "WY"))
Then, we will set up the combo box
Me.ComboBox1.DataSource = USStates
ComboBox1.DisplayMember = "LongName"
ComboBox1.ValueMember = "ShortName"
--- to test this, we'd play with selectedIndexChanged thing
Private Sub ComboBox1_SelectedIndexCha
If Me.ComboBox1.SelectedIndex
Me.Label4.Text = ""
Me.Label2.Text = ""
Me.Label1.Text = ""
Me.Label3.Text = ""
Me.Label1.Text = CType(Me.ComboBox1.Selecte
Me.Label2.Text = Me.ComboBox1.SelectedValue
Me.Label3.Text = Me.ComboBox1.SelectedItem.
Me.Label4.Text = Me.ComboBox1.Text
End If
End Sub
---
Hope this helps
Business Accounts
Answer for Membership
by: seeflatPosted on 2003-09-19 at 11:00:41ID: 9395178
You can explicitly add ListItem's to the Items collection of the combobox.
ListItem li = new ListItem();
li.Text = "ItemText";
li.Value = "ItemValue";
myCombo.Items.Add(li);
HTH