.NET Framework Class Library
CollectionEditor Class

Updated: November 2007

Provides a user interface that can edit most types of collections at design time.

Namespace:  System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

Visual Basic (Declaration)
Public Class CollectionEditor _
    Inherits UITypeEditor
Visual Basic (Usage)
Dim instance As CollectionEditor
C#
public class CollectionEditor : UITypeEditor
Visual C++
public ref class CollectionEditor : public UITypeEditor
J#
public class CollectionEditor extends UITypeEditor
JScript
public class CollectionEditor extends UITypeEditor

The following code example uses an EditorAttribute to associate the CollectionEditor with a property.

Visual Basic
<EditorAttribute(GetType(System.ComponentModel.Design.CollectionEditor), GetType(System.Drawing.Design.UITypeEditor))>  _
Public Property testCollection() As ICollection
   Get
      Return Icollection
   End Get
   Set
      Icollection = value
   End Set
End Property
Private Icollection As ICollection

C#
[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ICollection testCollection
{
    get
    {
        return Icollection;
    }
    set
    {
        Icollection = value;
    }
}
private ICollection Icollection;

Visual C++
public:
   [EditorAttribute(System::ComponentModel::Design::CollectionEditor::typeid,
      System::Drawing::Design::UITypeEditor::typeid)]
   property ICollection^ testCollection 
   {
      ICollection^ get()
      {
         return Icollection;
      }
      void set( ICollection^ value )
      {
         Icollection = value;
      }
   }
private:
   ICollection^ Icollection;

J#
/** @attribute EditorAttribute(System.ComponentModel.Design.
    CollectionEditor.class, System.Drawing.Design.UITypeEditor.class)
 */
/** @property 
 */
public ICollection get_TestCollection()
{
    return iCollection;
} //get_TestCollection

/** @property 
 */
public void set_TestCollection(ICollection value)
{
    iCollection = value;
} //set_TestCollection

private ICollection iCollection;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Page view tracker