# Customize the Buttons

RadAutoSuggestBox has two customizable buttons - the clear button and the query button.

You can customize those by setting the **ClearButtonContent** and **QueryButtonContent** properties.

## Changing Button Icons

The default content template of the buttons contains a [RadGlyph](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/glyphs/common-styles-appearance-glyphs-radglyph) control, so you can use a [glyph code](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/glyphs/common-styles-appearance-glyphs-reference-sheet) to easily change the default icons. You can also specify an emoji or text character directly as the button content.

> tip See the default buttons appearance in the [Visual Structure](https://www.telerik.com/products/wpf/documentation/controls/radautosuggestbox/visual-structure) article.

**Example 1: Changing the default glyphs**

```XAML
<telerik:RadAutoSuggestBox QueryButtonContent="&#xe019;" ClearButtonContent="&#xe10c;" />
```

> caption Query and clear buttons with changed glyph icons

![WPF RadAutoSuggestBox Query and clear buttons with changed glyph icons](https://www.telerik.com/products/wpf/documentation/assets/aaf494eb73b95d9efd74b26a263d73b3/radautosuggestbox-appearance-customize-buttons-0.png)

## Customizing the Buttons UI

To replace the default RadGlyph element used to display the buttons' content, set the **QueryButtonContentTemplate** and **ClearButtonContentTemplate** properties of RadAutoSuggestBox.

**Example 2: Changing the default content template**

```XAML
<telerik:RadAutoSuggestBox QueryButtonContent="Search" ClearButtonContent="X">
    <telerik:RadAutoSuggestBox.QueryButtonContentTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding}" Foreground="White" Background="#2D2D30" Padding="3" Opacity="0.8"/>
        </DataTemplate>
    </telerik:RadAutoSuggestBox.QueryButtonContentTemplate>
    <telerik:RadAutoSuggestBox.ClearButtonContentTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding}" Foreground="Red" FontWeight="Bold"/>
        </DataTemplate>
    </telerik:RadAutoSuggestBox.ClearButtonContentTemplate>
</telerik:RadAutoSuggestBox>
```

> caption Query and clear buttons with changed content template

![WPF RadAutoSuggestBox Query and clear buttons with changed content template](https://www.telerik.com/products/wpf/documentation/assets/d7aad37cf7c06a4c86880e4b8e54431a/radautosuggestbox-appearance-customize-buttons-1.png)

## Hiding the Buttons

To control the visibility of the query and clear buttons, set the **QueryButtonVisibility** and **ClearButtonVisibility** properties of RadAutoSuggestBox.

**Example 3: Hiding the query button**

```XAML
<telerik:RadAutoSuggestBox QueryButtonVisibility="Collapsed" />
```

> caption Hidden query button

![WPF RadAutoSuggestBox Hidden query button](https://www.telerik.com/products/wpf/documentation/assets/5342d55ca02292a9616bda080043afc0/radautosuggestbox-appearance-customize-buttons-2.png)

When the **ClearButtonVisibility** property is set to **Auto**, the button shows only when the control is focused and the TextBox is not empty. This is the default behavior.

## Commands

To customize also the actions executed on query and clear button clicks, set the **QueryButtonCommand** and **ClearButtonCommand** properties of RadAutoSuggestBox. Read more in the [Commands](https://www.telerik.com/products/wpf/documentation/controls/radautosuggestbox/features/commands-support) article.

## See Also

* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radautosuggestbox/getting-started)
* [Events](https://www.telerik.com/products/wpf/documentation/controls/radautosuggestbox/events)
* [Xaml vs. NoXaml](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/xaml-vs-noxaml)
