# Autogenerated Property Definitions

By default, RadPropertyGrid creates its property definitions automatically based on the type of the corresponding properties. Thus the proper editor controls are text fields for string properties, CheckBoxes for Boolean, ComboBoxes for enums.

> caption RadPropertyGrid with autogenerated property definitions

![RadPropertyGrid with autogenerated property definitions](https://www.telerik.com/products/wpf/documentation/assets/1f5470d4767c60a6f052c0359ef972b3/radpropertygrid_gettingstarted3.png)

However, you are free to change each of the property definitions displayed. What you need to do is to set the **AutoGeneratePropertyDefinitions** property of RadPropertyGrid to **"True"** and handle the **AutoGeneratingPropertyDefinition** event. As it is cancelable, you may reject the creation of a particular property definition.

The arguments of the **AutoGeneratingPropertyDefinition** event are:

* **Cancel**: Gets or set a value that indicates whether the operation should be cancelled.

* **PropertyDefinition**: Gets or sets the property definition for each of the properties. You may edit the following properties of each property definition:

  * **Binding**: Points to the data member to display/edit in the field.

  * **Description**: The description of a property.

  * **DisplayName**: The displayed name.

  * **EditorTemplate**: The DataTemplate for the editor of the property. If left unset, a default editor will be generated.

  * **GroupName**: The group name used to organize properties in categories.

  * **HasNestedProperties**: Indicates whether this property definition has nested property definitions.

  * **NestedProperties**: The collection of nested properties.

  * **OrderIndex**: The index of the order.

  * **ParentProperty**: The parent property of this property definition.

The AutoGeneratingPropertyDefinition event will be fired for each property of the item, thus enabling you to customize the view on property basis.
So, for example, let us decide on defining a Description for the Background property of RadButton bound to RadPropertyGrid.

**Example 1: AutoGeneratingPropertyDefinition event**

```C#
private void PropertyGrid1_AutoGeneratingPropertyDefinition(object sender, Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs e)
{
    if (e.PropertyDefinition.DisplayName == "Background")
    {
        e.PropertyDefinition.Description = "This property displays the background property of the RadButton";
    }
}
```

```VB.NET
	Private Sub PropertyGrid1_AutoGeneratingPropertyDefinition(sender As Object, e As Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs)
	    If e.PropertyDefinition.DisplayName = "Background" Then
	        e.PropertyDefinition.Description = "This property displays the background property of the RadButton"
	    End If
	End Sub
```

> caption RadPropertyGrid with customized autogenerated property definitions

![RadPropertyGrid with customized autogenerated property definitions](https://www.telerik.com/products/wpf/documentation/assets/a427239d45c090782e9f23d3c5b37a64/radpropertygrid_autogeneratedpropertydefinitions.png)

## See Also

[Customized Property Definitions](https://www.telerik.com/products/wpf/documentation/controls/radpropertygrid/getting-started/gettingstarted-customized-property-definitions)

[Nested Properties](https://www.telerik.com/products/wpf/documentation/controls/radpropertygrid/features/nested-properties)
