# Editors

## Content

PropertyGrid provides a variety of built-in editors and also allows you to create custom editors. Let us discuss about these editors in detail in the following sections.

## Built-in Editors

The PropertyGrid control includes several built-in editors. If you do not specify an editor, **PropertyGrid** displays each member with a default editor. Hence, you can specify editors based on your requirements and also create your own custom editor, if needed. PropertyGrid provides the [AvailableEditors](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.C1PropertyGrid.AvailableEditors.html) property in the [C1PropertyGrid](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.C1PropertyGrid.html) class, which provides you a list of all the built-in editors available in the **PropertyGrid** control.

The following table lists the built-in editors available in PropertyGrid.

| **Editor** | **Description** |
| ------ | ----------- |
| BoolEditor | Default editor used by C1PropertyGrid to edit Boolean values. |
| BrushEditor | Default editor used by C1PropertyGrid to edit Brush values. |
| ColorPaletteEditor | Default editor used by C1PropertyGrid to edit color palette values. |
| EnumEditor | Default editor used by C1PropertyGrid to edit Enum values. |
| ImageSourceEditor | Default editor used by C1PropertyGrid to edit image values. |
| NumericEditor | Default editor used by C1PropertyGrid to edit numeric values. |
| StringEditor | Default editor used by C1PropertyGrid to edit String values. |
| UriEditor | Default editor used by C1PropertyGrid to edit Uri values. |

## Custom Editors

As the built-in editors in **PropertyGrid** control are unable to support complex objects, these objects are shown in the default editor (StringEditor). Hence, you may want to create a custom editor to show complex objects so that it fits your needs. You can easily create your own editors to use with the **PropertyGrid** control. To do so, follow these simple steps:

1. Create a class that implements the [IPropertyGridEditor](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.IPropertyGridEditor.html) interface.
2. Add an instance of this class to the **AvailableEditors** collection on the PropertyGrid control or specify this class as the editor for a specific property by adding an **EditorAttribute** to the property definition.

The **IPropertyGridEditor** interface contains the following members:

* **bool** **[Supports](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.IPropertyGridEditor.Supports.html)(PropertyInfo property)**
    This method is used by the **C1PropertyGrid** to determine whether the editor supports the type of a given property.
* **void [Attach](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.IPropertyGridEditor.Attach.html)(FrameworkElement editor, PropertyGroup group, Action\<FrameworkElement, object> valueChanged)**
<br>
    This method is called when initializing the editor with the property it will manage. This typically consists of initializing the editor content based on the current property value.
* **void** **[Detach](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.IPropertyGridEditor.Detach.html)(FrameworkElement editor)**
    This method is called when the editor instance is being released.
* **FrameworkElement [Create](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.IPropertyGridEditor.Create.html)(C1PropertyGrid parent)**
<br>
    This method is called when the **C1PropertyGrid** needs a new instance of the editor.

To understand how to create your own custom editor programmatically, see the [Nested Properties](/componentone/docs/wpf/online-propertygrid5/nested-properties) topic.