# DropDownStyle

The **RadDropDownList.DropDownStyle** property determines if the text area at the top of the control can be edited. A setting of *DropDown* (the default) allows editing and the *DropDownList* setting shows the text area as read-only.

> caption Figure 1: DropDown

![WinForms RadDropDownList DropDown](https://www.telerik.com/products/winforms/documentation/assets/31aa704d390d838f0d36988b5732f6cf/dropdown-and-listcontrol-dropdownlist-dropdownstyle001.png)

> caption Figure 2: DropDownList

![WinForms RadDropDownList DropDownList](https://www.telerik.com/products/winforms/documentation/assets/12216f210466dfbf6ad0f18d80bd9e72/dropdown-and-listcontrol-dropdownlist-dropdownstyle002.png)

## Setting DropDownStyle

```C#

this.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
        
```

```VB.NET
Me.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
```

When **RadDropDownList** is set to *RadDropDownStyle.DropDownList* one can control if an image will be displayed in the editor:

### Image in Editor

```C#

this.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
this.radDropDownList1.ShowImageInEditorArea = false;

```

```VB.NET
Me.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList
Me.radDropDownList1.ShowImageInEditorArea = False
```

## User Defined Values

This section describes how user defined values can be added to the data source populating the items in **RadDropDownList**. For the purpose we are going to bind the control to a BindingList instance and add the newly created item if the Enter key has been pressed.

> caption Figure 3: Adding User Defined Values

![WinForms RadDropDownList Adding User Defined Values](https://www.telerik.com/products/winforms/documentation/assets/907bcd4a7e39273d90955f9772ad9d4f/dropdown-and-listcontrol-dropdownlist-dropdownstyle003.gif)

### Initial Set Up

```C#
private BindingList<string> data;

public DropDownListUserDefinedValues()
{
    InitializeComponent();

    this.data = new BindingList<string>();

    this.data.Add("Sofia");
    this.data.Add("New York");
    this.data.Add("Delhi");
    this.data.Add("Tokyo");
    this.data.Add("Berlin");
    this.data.Add("Moscow");
    this.data.Add("Beijing");
    this.data.Add("Bern");
    this.data.Add("Paris");
    this.data.Add("London");

    this.radDropDownList1.DataSource = this.data;
    this.radDropDownList1.KeyUp += radDropDownList1_KeyUp;
}
```

```VB.NET
Private data As BindingList(Of String)

Public Sub New()
    InitializeComponent()

    Me.data = New BindingList(Of String)()

    Me.data.Add("Sofia")
    Me.data.Add("New York")
    Me.data.Add("Delhi")
    Me.data.Add("Tokyo")
    Me.data.Add("Berlin")
    Me.data.Add("Moscow")
    Me.data.Add("Beijing")
    Me.data.Add("Bern")
    Me.data.Add("Paris")
    Me.data.Add("London")

    Me.RadDropDownList1.DataSource = Me.data
    AddHandler Me.RadDropDownList1.KeyUp, AddressOf RadDropDownList1_KeyUp
End Sub
```

Now we need to handle the event, perform the required checks and update our data source.

#### Initial Set Up

```C#
private void radDropDownList1_KeyUp(object sender, KeyEventArgs e)
{
    string result = this.radDropDownList1.DropDownListElement.Text;
    if (e.KeyCode == Keys.Enter && !this.data.Contains(result))
    {
        this.data.Insert(0, result);
    }

}
```

```VB.NET
Private Sub RadDropDownList1_KeyUp(sender As Object, e As KeyEventArgs)
    Dim result As String = Me.RadDropDownList1.DropDownListElement.Text
    If e.KeyCode = Keys.Enter AndAlso Not Me.data.Contains(result) Then
        Me.data.Insert(0, result)
    End If

End Sub
```

## See Also

* [Indicating Focus in RadDropDownList](https://www.telerik.com/products/winforms/documentation/knowledge-base/dropdownlist-style-indicating-focus)
