# Property Display Names

## Content



When you bind an object to the PropertyGrid, it allows you to set the display name for each property you add for that object to be displayed at runtime. This can be easily achieved at design-time by following these steps:

1.  Select the PropertyGrid and locate the **PropertyAttributes** collection under **Data** category in the **Properties** window.
2.  Click the ellipsis button next to the **PropertyAttributes** to open the collection editor.
3.  In the **PropertyAttributes Collection Editor**, add a property using the **Add** button and mention its **MemberName** and the **DisplayName** from the **Properties** pane.

## Set Property Display Name using Attributes

By default, the labels shown next to each property display the property names. This works fine in many cases, but you may want to customize the display to provide more descriptive names. The easiest way to achieve this is to customize the object properties with custom attributes.

The following image shows how **PropertyGrid** appears after customizing the display name:

![](https://cdn.mescius.io/document-site-files/images/15fca5e9-dae1-4baf-a2d2-e723426e0842/images/property-display-name.png)

To customize the display names, you could define the **DisplayAttribute** in the class itself and set the value for the **Name** property as in the following code. The following example uses the sample created in [Quick Start for binding PropertyGrid to a class](/componentone/docs/wpf/online-propertygrid5/quickstart#class).

```csharp
public class Customer
{
  [Display(Name = "Customer Name")]
  public string Name { get; set; }
  [Display(Name = "e-Mail address")]
  public string EMail { get; set; }
  public string Address { get; set; }
  [Display(Name = "Customer Since")]
  public DateTime CustomerSince { get; set; }
  [Display(Name ="Send Newsletter")]
  public bool SendNewsletter { get; set; }
  [Display(Name ="Point Balance")]
  public int? PointBalance { get; set; }
}
```

This method requires you to have access to the class being displayed in the PropertyGrid control. If you want to change the display strings but are unable to modify the class being used, then you would need to use the [C1PropertyGrid.PropertyAttributes](/componentone/api/wpf/online-propertygrid5/dotnet-api/C1.WPF.PropertyGrid/C1.WPF.PropertyGrid.C1PropertyGrid.PropertyAttributes.html) property to provide explicit information about each property you want to show on the PropertyGrid.