How stop SelectedIndex event datasource???

jenn5175

Freshman
Joined
Apr 4, 2002
Messages
35
Has anyone populated a combobox using .datasource, .displaymember, .valuemember? For some reason when it is populating, it is firing the "onSelectedIndexChanged" each time it is adding an item (this COULD be an SDE bug since I am developing for handhelds using VB.NET SDE beta 1). I have a second level of comboboxes which populate using the "SelectedIndexChanged" event so I MUST find out how to stop the pre-population firing of the event. Can anyone help me think of a way around this?

Here's the jist of what I'm doing. I need to populate a level 1 combobox with GM brands. Then, when a brand is selected, I need to populate a second level combobox with all models for that brand. Since it will be a remote db connection on a handheld, I only want to run to the db once.

(1) Run a SQL statement to get all records (all brand/model combos)

(2) Put each record into a homemade object (don't believe datagrids exist with SDE)

(3) Put each recordObject into an mainArrayList

(4) Looped through mainArrayList to find only those with distinct brand names (so no replication in level1 combo) and built tempArrayList (holding just one copy of each brand name)

(5) Populated level1combo using:
level1combo.DataSource = tempArrayList
level1combo.displayMember = "getBrandName"
level1combo.valueMember = "getBrandCode"

(6) Then, when a brand is selected, I build a new temp array containing only those recordObjects from mainArrayList whose "getBrandName" is level1combo.selectedItem and populate level2combo the same way as above.

However, it is taking forever because for each item added to level1combo, level1combo.selectedItemChanged is firing so its populating the level2combo. This is ridiculous! Can anyone help either with a fix for this bug or possibly a work around? I'm at a loss!

Thanks,
Jenn
 
I HAVE THE SAME PROBLEM....

I tried to go it around with a boolean value

in event procedures SelectedIndexChanged

but is ridicolus that for the population of each

combo the procedure goes in SelectedIndexChanged
to do nothing every time I add an item to my combo!!!!!

Geppo72
 
Back
Top