c# - Multiple Listboxes bound to same List -


I'm trying to tie several listboxes into one list. When a listback is updated on one form, then I want to update it also in the other list box.

The problem I am facing is that when I update the view box does not update the view in the underlying list if I look at the list box. Appearing in the debug, I can see that whatever items I add are there but it is not being displayed. In addition, when I open any other form that displays a list on the listboxes, it displays correctly whatever is already added.

  Private list & lt; String & gt; _list; Public Form 1 () {Initialization (); _list = Static InstanceAflist. Gate instance (); Listbox1.DataSource = _list; } Public Zero AddStringToList (string value) {if (! _list.Contains (value)) {_list.Add (value); }}  

Try to use to store your item and then both Assign this list to property through listboxes.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -