Link to home
Start Free TrialLog in
Avatar of chadmanvb
chadmanvb

asked on

Fill combobox with listview info .net 2.0

I ahve a list view and would like to populate a combobox when I click on it.  So on the click event for the listview I have:

MsgBox(ListView1.SelectedItems(0).SubItems(7).Text.ToString.ToUpper)

        ComboBox1.Text = ListView1.SelectedItems(0).SubItems(7).Text.ToString.ToUpper  'PATCH

The msgbox shows what i want, but it does not populate combobox1 with the info.  Also msgbox is a valid choice for the dropdown list.  Combobox one is setup as a dropdown list.  How can I make this work?
Avatar of pkbugudai
pkbugudai
Flag of India image

Dear!!!

try this

ComboBox1.Items.Add( ListView1.SelectedItems(0).SubItems(7).Text.ToString.ToUpper)


http://msdn.microsoft.com/en-us/library/19fc31ss.aspx
Avatar of chadmanvb
chadmanvb

ASKER

That does add it to my combobox list, but does not fill the combobox with the text, it's still blank
Dear!!!

if it is adding to combobox then it should display the text. please check the code or debug the code if the combobox is getiing binded again after adding the values.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect!  That's what i was looking for.