How does the Add method from the NameObjectCollectionBase collection behave?

Why is the Add method on the NameObjectCollectionBase tab at index position 0? Is there a way to insert a new item at the end of the collection?

I faced this problem in .Net 2.0

I am not allowed to modify the collection.

0


source to share


1 answer


NameObjectCollectionBase

is based on Hashtable / Dictionary, so it is "unsorted" in nature.

I think what you are looking for SortedList

.



Update: If you can't change the class, you're out of luck. Just remember, after each addition / insertion "positions" may change.

0


source







All Articles