Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection as DataSource in ListBox
Message
 
To
28/02/2005 14:38:45
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00990658
Message ID:
00991325
Views:
19
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform