New to Telerik UI for WPFStart a free 30-day trial

Represents a customizable auto-completion box control that allows users to select from a filtered list of suggestions based on their input. The RadAutoCompleteBox supports single and multiple selection modes, provides features like watermark content, dropdown item templates, and various behaviors for filtering and highlighting items. It uses dependency properties to manage its state and appearance, including search text, selected items, and dropdown properties. This control includes built-in keyboard navigation and event handling for selection changes, making it suitable for enhancing user input experiences in applications.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Input.dll

Syntax:

C#
[TelerikToolboxCategory("Input")]
[Themable]
public class RadAutoCompleteBox : Control, IDisposable

Inheritance: objectRadAutoCompleteBox

Implements: IDisposable

Constructors

Initializes a new instance of the RadAutoCompleteBox class.

C#
public RadAutoCompleteBox()

Fields

AutoCompleteModeProperty

DependencyProperty

Identifies the AutoCompleteMode dependency property.

C#
public static readonly DependencyProperty AutoCompleteModeProperty

BoxesItemStyleProperty

DependencyProperty

Identifies the BoxesItemStyle dependency property.

C#
public static readonly DependencyProperty BoxesItemStyleProperty

Identifies the BoxesItemStyleSelector dependency property.

C#
public static readonly DependencyProperty BoxesItemStyleSelectorProperty

BoxesItemTemplateProperty

DependencyProperty

Identifies the BoxesItemTemplate dependency property.

C#
public static readonly DependencyProperty BoxesItemTemplateProperty

Identifies the BoxesItemTemplateSelector dependency property.

C#
public static readonly DependencyProperty BoxesItemTemplateSelectorProperty

DisplayMemberPathProperty

DependencyProperty

Identifies the DisplayMemberPath dependency property.

C#
public static readonly DependencyProperty DisplayMemberPathProperty

Identifies the DropDownItemTemplate dependency property.

C#
public static readonly DependencyProperty DropDownItemTemplateProperty

Identifies the DropDownItemTemplateSelector dependency property.

C#
public static readonly DependencyProperty DropDownItemTemplateSelectorProperty

DropDownPlacementProperty

DependencyProperty

Identifies the DropDownPlacement dependency property.

C#
public static readonly DependencyProperty DropDownPlacementProperty

DropDownWidthProperty

DependencyProperty

Identifies the DropDownWidth dependency property.

C#
public static readonly DependencyProperty DropDownWidthProperty

FilteredItemsProperty

DependencyProperty

Identifies the MaxDropDownWidthProperty dependency property.

C#
public static readonly DependencyProperty FilteredItemsProperty

FilteringBehaviorProperty

DependencyProperty

Identifies the FilteringBehavior dependency property.

C#
public static readonly DependencyProperty FilteringBehaviorProperty

HighlightBehaviorProperty

DependencyProperty

Identifies the HighlightBehavior dependency property.

C#
public static readonly DependencyProperty HighlightBehaviorProperty

IsDropDownOpenProperty

DependencyProperty

Identifies the IsDropDownOpen dependency property.

C#
public static readonly DependencyProperty IsDropDownOpenProperty

IsHighlightedProperty

DependencyProperty

Identifies the IsHighlighted dependency property.

C#
public static readonly DependencyProperty IsHighlightedProperty

ItemsSourceProperty

DependencyProperty

Identifies the ItemsSource dependency property.

C#
public static readonly DependencyProperty ItemsSourceProperty

MaxDropDownHeightProperty

DependencyProperty

Identifies the MaxDropDownHeight dependency property.

C#
public static readonly DependencyProperty MaxDropDownHeightProperty

MaxDropDownWidthProperty

DependencyProperty

Identifies the MaxDropDownWidthProperty dependency property.

C#
public static readonly DependencyProperty MaxDropDownWidthProperty

MinDropDownWidthProperty

DependencyProperty

Identifies the MinDropDownWidthProperty dependency property.

C#
public static readonly DependencyProperty MinDropDownWidthProperty

NoResultsContentProperty

DependencyProperty

Identifies the NoResultsContent dependency property.

C#
public static readonly DependencyProperty NoResultsContentProperty

Identifies the NoResultsContentTemplate dependency property.

C#
public static readonly DependencyProperty NoResultsContentTemplateProperty

SearchTextProperty

DependencyProperty

Identifies the MaxDropDownWidthProperty dependency property.

C#
public static readonly DependencyProperty SearchTextProperty

SelectedItemProperty

DependencyProperty

Identifies the SelectedItem dependency property.

C#
public static readonly DependencyProperty SelectedItemProperty

SelectedItemsProperty

DependencyProperty

Identifies the SelectedItems dependency property.

C#
public static readonly DependencyProperty SelectedItemsProperty

Occurs when the selection of a RadAutoCompleteBox changes.

C#
public static readonly RoutedEvent SelectionChangedEvent

SelectionModeProperty

DependencyProperty

Identifies the SelectionMode dependency property.

C#
public static readonly DependencyProperty SelectionModeProperty

TextBoxStyleProperty

DependencyProperty

Identifies the TextBoxStyle dependency property.

C#
public static readonly DependencyProperty TextBoxStyleProperty

TextSearchModeProperty

DependencyProperty

Identifies the TextSearchMode dependency property.

C#
public static readonly DependencyProperty TextSearchModeProperty

TextSearchPathProperty

DependencyProperty

Identifies the TextSearchPath dependency property.

C#
public static readonly DependencyProperty TextSearchPathProperty

WatermarkContentProperty

DependencyProperty

Identifies the WatermarkContent dependency property.

C#
public static readonly DependencyProperty WatermarkContentProperty

Properties

Specifies the autocomplete mode for the RadAutoCompleteBox. This is a dependency property.

C#
public AutoCompleteMode AutoCompleteMode { get; set; }

Gets or sets the System.Windows.Style used to display each item into the boxes part of the control. This is a dependency property.

C#
public Style BoxesItemStyle { get; set; }

Gets or sets the System.Windows.Controls.StyleSelector used to choose System.Windows.Style to display each item into the boxes part of the control. This is a dependency property.

C#
public StyleSelector BoxesItemStyleSelector { get; set; }

BoxesItemTemplate

DataTemplate

Gets or sets the System.Windows.DataTemplate used to display each item into the boxes part of the control. This is a dependency property.

C#
public DataTemplate BoxesItemTemplate { get; set; }

BoxesItemTemplateSelector

DataTemplateSelector

Gets or sets the System.Windows.Controls.DataTemplateSelector used to choose System.Windows.DataTemplate to display each item into the boxes part of the control. This is a dependency property.

C#
public DataTemplateSelector BoxesItemTemplateSelector { get; set; }

The name or path of the property that is displayed for each the data item in the control. The default is an empty string (""). This is a dependency property.

C#
public string DisplayMemberPath { get; set; }

Gets or sets the System.Windows.DataTemplate used to display each item into the DropDown part of the control. This is a dependency property.

C#
public DataTemplate DropDownItemTemplate { get; set; }

DropDownItemTemplateSelector

DataTemplateSelector

Gets or sets the System.Windows.Controls.DataTemplateSelector used to choose System.Windows.DataTemplate to display each DropDown item into the dropdown part of the control. This is a dependency property.

C#
public DataTemplateSelector DropDownItemTemplateSelector { get; set; }

Gets or sets value indicating where the DropDown part of the control will be placed. This is a dependency property.

C#
public AutoCompleteDropDownPlacement DropDownPlacement { get; set; }

DropDownWidth

GridLength

Gets or sets a GridLength that indicates what the RadAutoCompleteBox' DropDown width will be.

C#
public GridLength DropDownWidth { get; set; }

Gets the currently filtered items into the RadAutoCompleteBox. This is a dependency property.

C#
public IEnumerable FilteredItems { get; }

Gets or sets the FilteringBehavior of the RadAutoCompleteBox. This is a dependency property.

C#
public IFilteringBehavior FilteringBehavior { get; set; }

Gets or sets the HighlightBehavior of the RadAutoCompleteBox. This is a dependency property.

C#
public IHighlightBehavior HighlightBehavior { get; set; }

Gets or sets the currently highlighted index in the dropdown portion of the control.

C#
protected int HighlightedIndex { get; set; }

Gets or sets the value that indicates whether the RadAutoCompleteBox dropdown is currently open. This is a dependency property.

C#
public bool IsDropDownOpen { get; set; }

Gets or sets a value indicating whether this instance is highlighted. This is a dependency property.

C#
public bool IsHighlighted { get; set; }

Gets or sets a collection that is filtered when the user enters text. This is a dependency property.

C#
public IEnumerable ItemsSource { get; set; }

Gets or sets the maximum height for a RadAutoCompleteBox drop-down. This is a dependency property.

C#
public double MaxDropDownHeight { get; set; }

Gets or sets the maximum width of a RadAutoCompleteBox drop-down. This is a dependency property.

C#
public double MaxDropDownWidth { get; set; }

Gets or sets the minimum width of a RadAutoCompleteBox drop-down. This is a dependency property.

C#
public double MinDropDownWidth { get; set; }

Gets or sets the content displayed in the dropdown if the filter result is empty.

C#
public object NoResultsContent { get; set; }

Gets or sets the System.Windows.DataTemplate used to display the content in the dropdown if the filter result is empty.

C#
public DataTemplate NoResultsContentTemplate { get; set; }

Gets or sets the string that is into the TextBox part of the RadAutoCompleteBox. The SearchText value is used to filter the RadAutoCompleteBox' ItemsSource. This is a dependency property.

C#
public string SearchText { get; set; }

Gets or sets the first item in the current selection or returns null if the selection is empty. This is a dependency property.

C#
public object SelectedItem { get; set; }

Gets or sets the list of currently selected items for the RadAutoCompleteBox. This is a dependency property.

C#
public IEnumerable SelectedItems { get; set; }

Specifies the selection mode for the RadAutoCompleteBox. This is a dependency property.

C#
public AutoCompleteSelectionMode SelectionMode { get; set; }

Gets or sets the style of the RadWatermarkTextBox into the RadAutoCompleteBox. This is a dependency property.

C#
public Style TextBoxStyle { get; set; }

Specifies the text search mode for the RadAutoCompleteBox. This is a dependency property.

C#
public TextSearchMode TextSearchMode { get; set; }

The name or path of the property that is used when filtering for each the data item in the control. The default is an empty string (""). This is a dependency property.

C#
public string TextSearchPath { get; set; }

Gets or sets the content to be shown when the TextBox is not focused. When in Single SelectionMode, no item should be selected for the content to be visible. This is a dependency property.

C#
public object WatermarkContent { get; set; }

Methods

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

C#
[Obsolete("The RadAutoCompleteBox control will no longer implement the IDisposable interface and this method will be removed in a future release.")]
public void Dispose()

Implements: IDisposable.Dispose()

Updates the visual state of the control.

C#
protected void GoToState(bool useTransition)
Parameters:useTransitionbool

Indicates whether transition should be used.

Contains the keyboard navigation logic of RadAutoCompleteBox.

C#
protected virtual bool HandleKeyDown(Key systemKey)
Parameters:systemKeyKey

The key that has been pressed.

Returns:

bool

True if the KeyDown event should be handled, otherwise false.

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .

C#
public override void OnApplyTemplate()

Called when the AutoCompleteMode property is changed.

C#
protected virtual void OnAutoCompleteModeChanged(AutoCompleteMode newValue)
Parameters:newValueAutoCompleteMode

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

The type-specific AutomationPeer implementation.

Called when the DisplayMemberPath property is changed.

C#
protected virtual void OnDisplayMemberPathChanged()

Called when the FilteringBehavior property is changed.

C#
protected virtual void OnFilteringBehaviorChanged()

Called before the System.Windows.UIElement.GotFocus event occurs.

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

Called before the System.Windows.UIElement.GotKeyboardFocus event occurs. Here the states of the AutoCompleteBox are updated. Added to work-around an issue with the Got and LostFocus events not getting fired.

C#
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters:eKeyboardFocusChangedEventArgs

Called when the HighlightBehavior property is changed.

C#
protected virtual void OnHighlightBehaviorChanged()

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Called when the IsDropDownOpen property is changed.

C#
protected virtual void OnIsDropDownOpenChanged(bool isOpen)
Parameters:isOpenbool

Called when the IsHighlighted property is changed.

C#
protected virtual void OnIsHighlightedChanged()

Called when the ItemsSource property is changed.

C#
protected virtual void OnItemsSourceChanged(object newValue, object oldValue)
Parameters:newValueobjectoldValueobject

Called before the System.Windows.UIElement.LostFocus event occurs.

C#
protected override void OnLostFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

Called before the event occurs to provide handling for the event in a derived class without attaching a delegate.

C#
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters:eMouseWheelEventArgs

A MouseWheelEventArgs that contains the event data.

Called when the SelectedItem property is changed.

C#
protected virtual void OnSelectedItemChanged(object newValue)
Parameters:newValueobject

Called when the SelectedItems property is changed.

C#
protected virtual void OnSelectedItemsChanged(IEnumerable newValue)
Parameters:newValueIEnumerable

Called when the selection changes.

C#
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters:eSelectionChangedEventArgs

The event data.

Called when the SelectionMode property is changed.

C#
protected virtual void OnSelectionModeChanged(AutoCompleteSelectionMode newValue)
Parameters:newValueAutoCompleteSelectionMode

Called when the TextBoxStyle property is changed.

C#
protected virtual void OnTextBoxStyleChanged()

Called when the TextSearchMode property is changed.

C#
protected virtual void OnTextSearchModeChanged(TextSearchMode textSearchMode)
Parameters:textSearchModeTextSearchMode

Called when the TextSearchPath property is changed.

C#
protected virtual void OnTextSearchPathChanged()

Called when the WatermarkContent property is changed.

C#
protected virtual void OnWatermarkContentChanged()

Searches through the AutoCompleteBox Items with the specified string input.

C#
public void Populate(string searchText)
Parameters:searchTextstring

The string used to search in the AutoCompleteBox.

Events

Occurs when the filtering of the RadAutoCompleteBox is finished and the FilteredItems are populated.

C#
public event EventHandler Populated

Populating

EventHandler<CancelRoutedEventArgs>

Occurs before the RadAutoCompleteBox' items are filtered using the current SearchText.

C#
public event EventHandler<CancelRoutedEventArgs> Populating

Occurs when SearchText property changes.

C#
public event EventHandler SearchTextChanged

SelectionChanged

SelectionChangedEventHandler

Occurs when the selection of the RadAutoCompleteBox changes.

C#
public event SelectionChangedEventHandler SelectionChanged
In this article
DefinitionConstructorsRadAutoCompleteBox()FieldsAutoCompleteModePropertyBoxesItemStylePropertyBoxesItemStyleSelectorPropertyBoxesItemTemplatePropertyBoxesItemTemplateSelectorPropertyDisplayMemberPathPropertyDropDownItemTemplatePropertyDropDownItemTemplateSelectorPropertyDropDownPlacementPropertyDropDownWidthPropertyFilteredItemsPropertyFilteringBehaviorPropertyHighlightBehaviorPropertyIsDropDownOpenPropertyIsHighlightedPropertyItemsSourcePropertyMaxDropDownHeightPropertyMaxDropDownWidthPropertyMinDropDownWidthPropertyNoResultsContentPropertyNoResultsContentTemplatePropertySearchTextPropertySelectedItemPropertySelectedItemsPropertySelectionChangedEventSelectionModePropertyTextBoxStylePropertyTextSearchModePropertyTextSearchPathPropertyWatermarkContentPropertyPropertiesAutoCompleteModeBoxesItemStyleBoxesItemStyleSelectorBoxesItemTemplateBoxesItemTemplateSelectorDisplayMemberPathDropDownItemTemplateDropDownItemTemplateSelectorDropDownPlacementDropDownWidthFilteredItemsFilteringBehaviorHighlightBehaviorHighlightedIndexIsDropDownOpenIsHighlightedItemsSourceMaxDropDownHeightMaxDropDownWidthMinDropDownWidthNoResultsContentNoResultsContentTemplateSearchTextSelectedItemSelectedItemsSelectionModeTextBoxStyleTextSearchModeTextSearchPathWatermarkContentMethodsDispose()GoToState(bool)HandleKeyDown(Key)OnApplyTemplate()OnAutoCompleteModeChanged(AutoCompleteMode)OnCreateAutomationPeer()OnDisplayMemberPathChanged()OnFilteringBehaviorChanged()OnGotFocus(RoutedEventArgs)OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)OnHighlightBehaviorChanged()OnInitialized(EventArgs)OnIsDropDownOpenChanged(bool)OnIsHighlightedChanged()OnItemsSourceChanged(object, object)OnLostFocus(RoutedEventArgs)OnMouseWheel(MouseWheelEventArgs)OnSelectedItemChanged(object)OnSelectedItemsChanged(IEnumerable)OnSelectionChanged(SelectionChangedEventArgs)OnSelectionModeChanged(AutoCompleteSelectionMode)OnTextBoxStyleChanged()OnTextSearchModeChanged(TextSearchMode)OnTextSearchPathChanged()OnWatermarkContentChanged()Populate(string)EventsPopulatedPopulatingSearchTextChangedSelectionChanged
Not finding the help you need?
Contact Support