Hi.
I have a hashtable filled with sereral elements.
I want to move a element up or down 1 position in the hashtable, is is possible and how?
Thanks.
Jorge
Printable View
Hi.
I have a hashtable filled with sereral elements.
I want to move a element up or down 1 position in the hashtable, is is possible and how?
Thanks.
Jorge
Firstly, you should use a generic Dictionary in preference to a Hastable in .NET 2.0.
Secondly, moving items up or down in a Hashtable has no meaning because they aren't ordered. The items have no index so you can't change their index. The point of a Hashtable is fast retrieval of values by key. There are SortedList and SortedDictionary classes that combine hashing and sorting, so maybe that's what you need.
Ok, i will drop the hashtable then.