Good question. The documentation for this class is very cryptic about how it
is "ordered." I can't tell for sure whether it is ordered internally (which
I doubt) or simply by the enumerator. The examples are bad in that when they
demonstrate getting the values in the OrderedDictionary by Keys, they use a
list that has been entered in non-alphabetical order, but when they
demonstrate getting the values using an enumerator, they enter the list
items in alphabetical order, thus muddying the waters as to why the items
came back *out* in alphabetical order. The text is not clear about this.
However, some experiments should answer the questions for you. I would
imagine that the items are added to the list in the order in which they were
actually added, and that when you get the keys by copying, the order is not
changed, which would satisfy your requirements. I would also guess (with
less confidence) that using an enumerator sorts the items. But again, it
shouldn't be hard to set up a test for this.

Signature
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
Big thicks are made up of lots of little thins.
> Hi,
> I want to use OrderedDictionary to get my objects in same order as they
[quoted text clipped - 7 lines]
> Thanks in advance,
> Suhaib
Check out the Power Collections library at www.wintellect.com. Lots of
generic goodness there...
> Hi,
> I want to use OrderedDictionary to get my objects in same order as they
[quoted text clipped - 7 lines]
> Thanks in advance,
> Suhaib