Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection as DataSource in ListBox
Message
 
À
28/02/2005 15:50:28
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00990658
Message ID:
00991388
Vues:
15
>Sorry, Einar ... I had to leave for lunch, right in the middle of our discussion!! In my last post, I was going to mention something similar along these lines, but didn't have time to post it before getting dragged off to lunch.

Lunch is very important <s>

>In SelectedIndexChanged event handlers, I always bracket my code in an "if (this.MyControl.SelectedIndex > -1)", which would amount to the same thing (in this case anyway), of you checking for a null DataSource.

I agree it is not a bad idea to check for the obvious, because sometimes it saves you a lot of hours debugging.

>
>What's strange though, as you said, is that it didn't throw any kind of exceptions when you tried to access an Item in your collection with a -1 indexer. Weird.

Yeah very odd.

>
>But, anywho ... glad you figured it out!!

Thank you for your patience helping me figure it out.

Sincerely,
Einar
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform