Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm having trouble with a databound listbox

In the help files for vb.net it says to just bind the listbox again after new data has been Inserted. This produces Duplicates in the listbox. How do i clear the databox before i re-bind it?

listbox1.Datasource.Clear() does nothing or so it seems.

 

Simpley put, i want to empty the listbox then rebind it.

  • *Experts*
Posted

Oh, sorry I misread a part of your post (I dont know why :)).

You would first need to eliminate the DataSource, by setting it to Nothing.

Posted

Ok i set the datasource to nothing

But somthing still isnt right.

Listbox2.Datasource = Nothing
Listbox2.Items.Clear() '<--  does nothing now
Listbox2.Items.Add("test string")' <-- does not appear in the listbox 

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...