# Customizing Editor

The appearance and behavior of property grid editors can be changed programmatically. This can be done in the **EditorInitialized** event. **EditorInitialized** is fired when the editor is created and initialized with a predefined set of properties.

The following sample demonstrates how to change the default font of a **BaseTextBoxEditor** in RadGanttView:

```C#
private void GanttViewElement_EditorInitialized(object sender, GanttViewItemEditorInitializedEventArgs e)
{
    BaseTextBoxEditor editor = e.Editor as BaseTextBoxEditor;

    if (editor != null)
    {
        ((RadTextBoxElement)editor.EditorElement).Font = new Font(FontFamily.Families[12], 12, FontStyle.Bold);
    }
}
```

```VB.NET
Private Sub GanttViewElement_EditorInitialized(sender As Object, e As GanttViewItemEditorInitializedEventArgs)
    Dim editor As BaseTextBoxEditor = TryCast(e.Editor, BaseTextBoxEditor)

    If editor IsNot Nothing Then
        DirectCast(editor.EditorElement, RadTextBoxElement).Font = New Font(FontFamily.Families(12), 12, FontStyle.Bold)
    End If
End Sub
```

## Mask Editor

The following sample demonstrates how to change the default font of a **GanttViewDateTimeEditor** in RadGanttView and apply **MaskDateTimeProvider** with a custom format for time:

```C#
private void GanttViewElement_MaskEditorInitialized(object sender, GanttViewItemEditorInitializedEventArgs e)
{
    GanttViewDateTimeEditor dtEditor = e.Editor as GanttViewDateTimeEditor;
    if (dtEditor != null)
    {
        dtEditor.CustomFormat = "hh/mm/ss";
        MaskDateTimeProvider dtprovider = ((BaseDateTimeEditorElement)dtEditor.EditorElement).TextBoxElement.Provider as MaskDateTimeProvider;
        dtprovider.AutoSelectNextPart = true;
    }
}
```

```VB.NET
Private Sub GanttViewElement_MaskEditorInitialized(ByVal sender As Object, ByVal e As GanttViewItemEditorInitializedEventArgs)
    Dim dtEditor As GanttViewDateTimeEditor = TryCast(e.Editor, GanttViewDateTimeEditor)

    If dtEditor IsNot Nothing Then
        dtEditor.CustomFormat = "hh/mm/ss"
        Dim dtprovider As MaskDateTimeProvider = TryCast((CType(dtEditor.EditorElement, BaseDateTimeEditorElement)).TextBoxElement.Provider, MaskDateTimeProvider)
        dtprovider.AutoSelectNextPart = True
    End If
End Sub
```

## See Also

* [Creating custom editor](https://www.telerik.com/products/winforms/documentation/controls/ganttview/editing/creating-custom-editor)
* [Editing Graphical View](https://www.telerik.com/products/winforms/documentation/controls/ganttview/editing/editing-graphical-view)
* [Editing Text View](https://www.telerik.com/products/winforms/documentation/controls/ganttview/editing/editing-text-view)
