Refresh combobox datasource

What simple piece of code am I missing?  Everything behind the scene is showing that the item is being added to the list but when the form shows, the addition isn't there.  I've tried refreshing the combo box, refreshing the screen, clearing databindings, used a simple combo box, a drop down, a dropdown list....  

                Dim waa As String = CStr(tblS.waa)

                Dim isit As Boolean = False

                For Each r In cbProfile.DataSource
                    If r = waa Then
                        isit = True
                    End If
                Next

                If isit = True Then
                    Me.cbProfile.SelectedItem = waa
                Else
                    listofProfile.Add(waa)
                    Me.cbProfile.DataSource = listofProfile <---- shows the added item here but not on the form

                End If

HELP please and thanks!
Karen WilsonProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert SchuttSoftware EngineerCommented:
This is quite cheesy, but before setting the datasource to the same list again, try setting it to nothing first:
            listofProfile.Add(waa)
            Me.cbProfile.DataSource = Nothing
            Me.cbProfile.DataSource = listofProfile ' <---- shows the added item here but not on the form

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Karen WilsonProgrammerAuthor Commented:
HA!!  I knew it....  I had tried everything except NOTHING.  It works.  Bill Gates and co. are going to make me nuts.  :O)  

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.