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:
00992171
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform