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.
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 property in the C1PropertyGrid 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. |
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:
The IPropertyGridEditor interface contains the following members:
To understand how to create your own custom editor programmatically, see the Nested Properties topic.