By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

Key-Value pair list - not sorted

P: n/a
I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?

Thanks

Mar 22 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
How about List<KeyValuePair<TKey,TValue>>?

Marc
Mar 22 '07 #2

P: n/a
On Mar 22, 10:57 am, "Sehboo" <MasoodAd...@gmail.comwrote:
I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?

Thanks
If you have a specific order of key value pairs you want to store, you
could use the generic list structure with key value pairs in it:

System.Collections.Generic.List<System.Collections .Generic.KeyValuePair<TKey,
TValue>>

But if you are trying to store them in a certain order, then it sounds
like you probably shouldn't be using key value pairs, but instead use
a struct that unites the two. The point of key value pairs is to look
them up by their key.

Mar 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.