Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execute code before SelectedIndexChanged in combobox occ
Message
From
03/02/2005 10:18:24
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00983452
Message ID:
00983460
Views:
12
Einar,

One solution is to create some events in your ComboBox sub-class (you *have* subclassed your controls, I hope). Create a BeforeSelectedIndexChanged event (and, while you're at it, you might as well create an AfterSelectedIndexChanged event also). Basically, you'd need some code in some of the mouse events and keydown/up events to properly fire the Before and After events. We've done it with a ListView, but not with a Combo ... should be somewhat similar, so I'm sure it's do-able.

Just some food for thought ...

~~Bonnie



>I would like to execute some code before the SelectedIndexChanged event occurs in a combobox. Based on the code executed I might not allow the SelectedIndex to change, i.e. revert back to the previous SelectedIndex.
>As far as I see the only relevant event is SelectedIndexChanged, and I would have to store the previous SelectedIndex and revert back manualy (i.e. through code).
>
>Any other thoughts on this issue would be appreciated.
>
>Thanks,
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform