Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a ListBox control bound to an ArrayList:

 

  Dim m_expressionFilters As ArrayList
 Dim m_expressionBindingManager As BindingManagerBase
 m_expressionFilters = New ArrayList
 m_expressionBindingManager = BindingContext(m_expressionFilters)
 lstboxFilters.DataSource = m_expressionFilters

When I add an Item to the ArrayList, that change is immediately reflected in

the ListBox:

 

  m_expressionBindingManager.SuspendBinding()
 m_expressionFilters.Add(CurrentFilter)
 m_expressionBindingManager.ResumeBinding()

However, when I call the Clear method of the ArrayList, the changes are not

reflected in the ListBox:

 

  m_expressionBindingManager.SuspendBinding()
 m_expressionFilters.Clear()
 m_expressionBindingManager.ResumeBinding()

At this point, the m_expressionFilters ArrayList has a Count of zero, but

the Items formerly held in the ArrayList are still listed on the form in the

ListBox. I have tried calling the Refresh and Update methods on the

ListBox, but that produced no visible changes at all.

 

Any help or advice would be greatly appreciated.

"Never ascribe to malice that which can adequately be explained by incompetence." -- Napolean Bonaparte

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...