I am trying to bind several ListBoxs to a List. When a ListBox on one form is updated, I want it to update the other ListBox, too.
The problem I am running into is that it doesn't seem to update the view on the ListBox when I update the underlying List. If I look at the ListBox.Items in debug, I can see that all the items I add are there, but are not being displayed. Additionally, when I open another form that displays the List on a ListBox, it does correctly display whatever items had already been added.
private List<String> _list;
public Form1()
{
InitializeComponent();
_list = StaticInstanceOfList.GetInstance();
listbox1.DataSource = _list;
}
public void AddStringToList(string value)
{
if (!_list.Contains(value))
{
_list.Add(value);
}
}