Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBox problems
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00992047
Message ID:
00992171
Vues:
16
>Chad,
>Using your code as an example I changed my code to the following:
>
>System.Int32 iselectedItemIndex = this.lstIndividualDelay.SelectedIndex;
>this.lstIndividualDelay.SelectedIndex = 0; // without this line here it will throw an error if I delete the last element and try to select one of the remaining elements
>this.lstIndividualDelay.DataSource = null;
>
>this.oIndividualDelayCollection.Remove(this.oIndividualDelayCollection[iselectedItemIndex]);
>this.lstIndividualDelay.DataSource = this.oIndividualDelayCollection;
>
>
>Thank you very much for looking into this problem, but I must say it is odd that I have to set SelectedIndex to 0 before I set DataSource to null. But it is working now and I can ponder why it is working instead of sleeping tonight <s>
>
>Again thanks,
>Einar

Glad it works and I could be of assistance.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform