Hi E?
Don't forget to set AutoPostBack="T rue" for the listbox. That will fire the
event in which you can transfer the item. Here's some code in VB:
Private Sub ListBox1_Select edIndexChanged _
(ByVal sender As Object, _
ByVal e As System.EventArg s) _
Handles ListBox1.Select edIndexChanged
Dim li As ListItem
li = ListBox1.Select edItem
DropDownList1.I tems.Add(li)
DropDownList1.S electedIndex = -1
ListBox1.Items. Remove(li)
End Sub
<form id="Form1" method="post" runat="server">
<asp:ListBox id="ListBox1" runat="server" AutoPostBack="T rue">
<asp:ListItem Value="CAR">CAR </asp:ListItem>
<asp:ListItem Value="DOG">DOG </asp:ListItem>
<asp:ListItem Value="BAT">BAT </asp:ListItem>
<asp:ListItem Value="HAT">HAT </asp:ListItem>
</asp:ListBox>
<asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>
</form>
Does this help?
Ken
Microsoft MVP [ASP.NET]
"Big E" <no****@nospam. com> wrote in message
news:O9******** ******@tk2msftn gp13.phx.gbl...
I'm using ASP.Net and 1 Listbox and 1 ComboBox.
When a user selects the contents in the listbox I want to populate the
combobox with the text that he selected or double clicked. I've tried
various things with the selecteditem, index properties to no avail.
Meaning: LISTBOX has CAR, DOG, BAT, HAT already populated in it.
When user selects DOG -> I would like to populate the ComboBox with DOG.
I'm writing everything in the vb file in code.
Thanks.