Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetItem Method

KeyedCollection.SetItem Method

Replaces the item at the specified index with the specified item.

Name Description
KeyedCollection.SetItem (Int32, T) Replaces the element at the specified index.
KeyedCollection.SetItem (Int32, TItem) Replaces the item at the specified index with the specified item.

Supported by the .NET Compact Framework.

This page contains an error. The KeyedCollection.SetItem(Int32,U) method and the inherited Collection.SetItem method are not overloads of the same method. In fact, the KeyedCollection.SetItem(Int32,U) method overrides the Collection.SetItem method. The two methods have the same signature because the base class of KeyedCollection<TKey, TItem> (KeyedCollection<TKey, TItem> in Visual Basic, generic<TKey, TItem> ref class KeyedCollection in C++) is Collection<TItem>, where the generic type parameter TItem of KeyedCollection is substituted for the generic type parameter T of the Collection generic class. The documentation build tools do not resolve these signatures correctly.

Community Additions

ADD
Show:
© 2015 Microsoft