trouble having ddlselection information display in seperate listbox

joelk

Member
Joined
Jul 15, 2009
Messages
6
Programming Experience
Beginner
I have a dropdownlist with different products in it. I also have a ListBox below it that needs to contain product information depending on which selection is chosen.

How can I program the ListBox to display the description of a selected product with VB?

The dropdownlist is not configured to a datasource, it just has three products in it.

I know this question is easy, but I still need a little back up.
 
For DropDownList control set AutoPostBack property to True if you want it to postback on selection change.
Doubleclick the control to generate the event handler for default event SelectedIndexChanged, here you can place this code:
VB.NET:
Me.Label1.Text = "description " & Me.DropDownList1.SelectedValue
 
For DropDownList control set AutoPostBack property to True if you want it to postback on selection change.
Doubleclick the control to generate the event handler for default event SelectedIndexChanged, here you can place this code:
VB.NET:
Me.Label1.Text = "description " & Me.DropDownList1.SelectedValue

What is the Me. command?
Ok, so for example I would type
VB.NET:
 Me.ListBox1.Text = "type description here" & Me.DropDownList1.SelectedValue

But how would I make it for all three different selected values?

VB.NET:
 Me.ListBox1.Text = "type description here" & Me.DropDownList1.SelectedValue[0]
Me.Listbox1.Text = "type description here" & Me.DropdownList1.SelectedValue[1]
etc 
etc.

?
 
Back
Top