Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the different?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00817137
Message ID:
00817327
Views:
22
Hi Stephen,

What is happening here is that the ValueMember of the ComboBox is being set after the DataSource. This causes the SelectedIndexChanged event to fire during initialization. If Kevin reverses the order of the population of the properties, this extra firing will not occur. I'm sure Kevin will look at this after he returns. You can detach the event in the Form_Load to prevent the unwanted event from firing and then reattach it after the binding of the control for now or you can leave you code as you have it.

>Correction, the SelectedValue initially contains a DataRowView instead of DataRow. Before the form actually shown on the screen, the SelectedIndexChanged event fired 3 times, the first 2 times SelectedValue contains DataRowView but the last time it contains integer.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform