Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBox problems
Message
De
02/03/2005 13:34:33
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00992047
Message ID:
00992086
Vues:
19
Wow Einar ... you sure do find the weird problems!! <g> At first I thought maybe it was because you removed the item from the Collection before you set the ListBox's DataSource back to null, so I tried switching the order of that around. It still crashes. You've got me stumped!!!

~~Bonnie



>I ran into some more problems related to my ListBox.
>I have a listbox on my form. I have set the listbox's datasource to a collection class object.
>I added a delete button with the follwoing code to delete an entry from the listbox:
>
>this.oIndividualDelayCollection.Remove(this.oIndividualDelayCollection[this.lstIndividualDelay.SelectedIndex]);
>this.lstIndividualDelay.DataSource = null;
>this.lstIndividualDelay.DataSource = this.oIndividualDelayCollection;
>
>
>Now lets assume that I have 3 items in my listbox (and in the collection object)
>Considder the following scenarios:
>1. I select the first element in the listbox and press the delete button. Element is deleted from the collection object and disapears from the listbox as expected and I can navigate between the remaining two items in the listbox.
>
>2. I select the 3rd item in the listbox and press the delete button. Element is deleted from the collection object and disapears from the listbox as expected, BUT I can not navigate between the remaining two elements of the listbox. Trying to click an element in the listbox throws an error and I can't find where the error is thrown from even when I step through with the debugger.
>
>Any help would be appreciated.
>
>Thanks,
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform