Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection as DataSource in ListBox
Message
 
To
28/02/2005 15:50:28
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00990658
Message ID:
00991388
Views:
13
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform