Export (0) Print
Expand All

CollectionEditor Class

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

For a list of all members of this type, see CollectionEditor Members.


[Visual Basic]
Public Class CollectionEditor
   Inherits UITypeEditor
public class CollectionEditor : UITypeEditor
public __gc class CollectionEditor : public UITypeEditor
public class CollectionEditor extends UITypeEditor

Thread Safety

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


Notes to Inheritors:  This editor can edit collections that have an Item property. The editor can determine the type of the collection from the Item property, if it exists. If the collection does not have this property, or if you want to provide collections of more than one type, you can override certain protected members of this class to customize the editor to support other types of collections.


[Visual Basic, C#, C++] 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
      Return Icollection
   End Get
      Icollection = value
   End Set
End Property
Private Icollection As ICollection

[EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ICollection testCollection
        return Icollection;
        Icollection = value;
private ICollection Icollection;

    __property ICollection* get_testCollection() {
        return Icollection;
    __property void set_testCollection(ICollection* value) {
        Icollection = value;
    ICollection*  Icollection;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.ComponentModel.Design

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

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

See Also

CollectionEditor Members | System.ComponentModel.Design Namespace | UITypeEditor

© 2014 Microsoft