Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection as DataSource in ListBox
Message
 
À
28/02/2005 14:38:45
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00990658
Message ID:
00991325
Vues:
18
Bonnie,
I think I have found an explanation now. I added the following code:
if (this.lstIndividualDelay.DataSource == null)
			{
				MessageBox.Show("null");
			}
			else
			{
				MessageBox.Show("not null");
				this.txtIncludeDelay.Text = this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex].IncludeDelay.ToString();
				this.txtIncludeFile.Text = this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex].IncludeFile.ToString();

			}
to the listbox.SelectedIndexChanged. Apparently the event fires when I set the DataSource to null, and that screws things up without notifying me that things are screwed up. Checking if datasource is null or not before changing the textbox.text property based on the selected index makes a lot of sense.
After discovering this the problem was very simple but I am surprised that exceptions where not thrown.
Ohh well.

Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform