try { this.oIndividualDelayCollection.Add(new ALS.ImageviewConfig.IndividualDelay(1,5)); this.oIndividualDelayCollection.Add(new ALS.ImageviewConfig.IndividualDelay(2,45)); this.oIndividualDelayCollection.Add(new ALS.ImageviewConfig.IndividualDelay(42,42)); this.lstIndividualDelay.DataSource = this.oIndividualDelayCollection; this.lstIndividualDelay.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.ToString()); }This is mostly test code at this point. I will in the future populate the collection by reading through an aspx file.
private void lstIndividualDelay_SelectedIndexChanged(object sender, System.EventArgs e) { this.txtIncludeDelay.Text = this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex].IncludeDelay.ToString(); this.txtIncludeFile.Text = this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex].IncludeFile.ToString(); }All this code does is display the contents of the collection element in two textboxes.
this.lstIndividualDelay.DataSource = null; this.oIndividualDelayCollection.Add(new ALS.ImageviewConfig.IndividualDelay(1,10)); this.lstIndividualDelay.DataSource = this.oIndividualDelayCollection;When I run the app and click the button the listbox does not update (no new item added), but when I click where the new item should be the information is displayed in the textboxes. Also if I click one of the elements I can see the textboxes are updated but the blue highlight is not changed.