Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ListBox problems
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00992047
Message ID:
00992119
Views:
21
Chad and Bonnie,
The following code in the in the delete button click throws an exception (ArgumentOutOfRangeException) , where the try catch block is, if the last item in the listbox is deleted
  this.oIndividualDelayCollection.Remove(this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex]);

this.lstIndividualDelay.DataSource = null;
this.lstIndividualDelay.DataSource = this.oIndividualDelayCollection;

try
{
  this.lstIndividualDelay.SelectedIndex = 0;
}
catch (Exception ex)
{
  MessageBox.Show(ex.ToString(), "In hereeeeeeee");
}
And also throws an ArgumentOutOfRangeException exception when I try to click on any of the remaining items in the listbox.

Maybe the exception type will give you another clue, but it didn't help me.

Any help is very appreciated.

Thanks,
Einar
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform