>How do I get the listbox to refresh/update its display?
Re-bind the listbox.
__avd
Posting Genius (adatapost)
8,737 posts since Oct 2008
Reputation Points: 2,141
Solved Threads: 1,262
Skill Endorsements: 51
Hi,
Personally, I wouldn't refresh the entire listbox. I'd just (programatically) select the relevant listbox item and remove it in the button click event.
Chris.
Chris147
Junior Poster in Training
58 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
Re-bind steps:
1. Fetch data from the database - you can use Fill method of dataAdapter.
2. Assign datasource to the listbox.
__avd
Posting Genius (adatapost)
8,737 posts since Oct 2008
Reputation Points: 2,141
Solved Threads: 1,262
Skill Endorsements: 51
To remove a listbox item:
Me.teachersList.Items.Remove(Me.teachersList.SelectedItem)
Chris147
Junior Poster in Training
58 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
ListBox1.DataSource=DataSet2.Users
ListBox1.DisplayMember="Name"
ListBox1.ValueMember="ID"
__avd
Posting Genius (adatapost)
8,737 posts since Oct 2008
Reputation Points: 2,141
Solved Threads: 1,262
Skill Endorsements: 51
Question Answered as of 3 Years Ago by
__avd
and
Chris147