Listbox/Combobox - .Sorted=True doesn't sort ItemData 
Author Message
 Listbox/Combobox - .Sorted=True doesn't sort ItemData

Below is just one example of what I'm running into:

I'm populating a dropdown combobox with state abbreviations from a SQL
Server table where the Select does an Order By on the state name.  The
following is the structure of the state table:

Column_name          Type                           Length
state_id                       int                            4
state_code                     char                           2
name                           varchar                        25
start_date                     datetime                       8
end_date                       datetime                       8
revised_by                     int                            4
revised_date                   datetime                       8

I have the .Sorted property set to True and am placing the state_id as the
ItemData values.  Trouble is, as I'm inserting the state_code and it's
being sorted, if a state_code gets moved up in the list, the ItemData of
the updated position value gets set to 0.  I know I can do an Order By on
state_code but, for the time being, I can't, as this would affect other
forms and time constraints prevent us from adding additional methods to the
DLL (all database access is done via components we've developed in VC 5.0
DLLs).

Basically, what I'm trying to say is it looks like the .ItemData values are
not tied to the .List values when the .Sorted property is set to True.  I
assume this is by design but it sure would be nice to have the two tied
together.
--

Later....

Jerry D. Turner (MVP - DTS / MCSE / ClubWin / ClubIE)
http://www.*-*-*.com/



Sat, 23 Oct 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. TreeView.Sorted = True doesn't work

2. sorted listbox and the itemdata property

3. Sorting a Listbox based on ItemData property

4. sorting listbox with sorted property on run time

5. Sort order - Edit Filter Sort or Quick Sort

6. Can't sort Outlook Personal Folder using Items.Sort

7. NEWBIE:Sorting ItemData property in combo box...

8. ItemData property sorting

9. ItemData screwed up after sort ???

10. ComboBox/Listbox Itemdata

11. ComboBox/Listbox Itemdata

12. Combo Box problem with SORTED = TRUE

 

 
Powered by phpBB® Forum Software