Class
RadAutoCompleteBox

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:

cs-api-definition
[TelerikToolboxCategory("Input")]
[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
[Themable]
public class RadAutoCompleteBox : Control, IDisposable

Inheritance: objectRadAutoCompleteBox

Implements: IDisposable

Constructors

RadAutoCompleteBox()

Initializes a new instance of the RadAutoCompleteBox class.

Declaration

cs-api-definition
public RadAutoCompleteBox()

Fields

AutoCompleteModeProperty

Identifies the AutoCompleteMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty AutoCompleteModeProperty

Field Value

DependencyProperty

BoxesItemStyleProperty

Identifies the BoxesItemStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BoxesItemStyleProperty

Field Value

DependencyProperty

BoxesItemStyleSelectorProperty

Identifies the BoxesItemStyleSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BoxesItemStyleSelectorProperty

Field Value

DependencyProperty

BoxesItemTemplateProperty

Identifies the BoxesItemTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BoxesItemTemplateProperty

Field Value

DependencyProperty

BoxesItemTemplateSelectorProperty

Identifies the BoxesItemTemplateSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty BoxesItemTemplateSelectorProperty

Field Value

DependencyProperty

DisplayMemberPathProperty

Identifies the DisplayMemberPath dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DisplayMemberPathProperty

Field Value

DependencyProperty

DropDownItemTemplateProperty

Identifies the DropDownItemTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DropDownItemTemplateProperty

Field Value

DependencyProperty

DropDownItemTemplateSelectorProperty

Identifies the DropDownItemTemplateSelector dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DropDownItemTemplateSelectorProperty

Field Value

DependencyProperty

DropDownPlacementProperty

Identifies the DropDownPlacement dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DropDownPlacementProperty

Field Value

DependencyProperty

DropDownWidthProperty

Identifies the DropDownWidth dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty DropDownWidthProperty

Field Value

DependencyProperty

FilteredItemsProperty

Identifies the MaxDropDownWidthProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FilteredItemsProperty

Field Value

DependencyProperty

FilteringBehaviorProperty

Identifies the FilteringBehavior dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty FilteringBehaviorProperty

Field Value

DependencyProperty

HighlightBehaviorProperty

Identifies the HighlightBehavior dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HighlightBehaviorProperty

Field Value

DependencyProperty

IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDropDownOpenProperty

Field Value

DependencyProperty

IsHighlightedProperty

Identifies the IsHighlighted dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsHighlightedProperty

Field Value

DependencyProperty

ItemsSourceProperty

Identifies the ItemsSource dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ItemsSourceProperty

Field Value

DependencyProperty

MaxDropDownHeightProperty

Identifies the MaxDropDownHeight dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MaxDropDownHeightProperty

Field Value

DependencyProperty

MaxDropDownWidthProperty

Identifies the MaxDropDownWidthProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MaxDropDownWidthProperty

Field Value

DependencyProperty

MinDropDownWidthProperty

Identifies the MinDropDownWidthProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty MinDropDownWidthProperty

Field Value

DependencyProperty

NoResultsContentProperty

Identifies the NoResultsContent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty NoResultsContentProperty

Field Value

DependencyProperty

NoResultsContentTemplateProperty

Identifies the NoResultsContentTemplate dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty NoResultsContentTemplateProperty

Field Value

DependencyProperty

SearchTextProperty

Identifies the MaxDropDownWidthProperty dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SearchTextProperty

Field Value

DependencyProperty

SelectedItemProperty

Identifies the SelectedItem dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedItemProperty

Field Value

DependencyProperty

SelectedItemsProperty

Identifies the SelectedItems dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedItemsProperty

Field Value

DependencyProperty

SelectionChangedEvent

Occurs when the selection of a RadAutoCompleteBox changes.

Declaration

cs-api-definition
public static readonly RoutedEvent SelectionChangedEvent

Field Value

RoutedEvent

SelectionModeProperty

Identifies the SelectionMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectionModeProperty

Field Value

DependencyProperty

TextBoxStyleProperty

Identifies the TextBoxStyle dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextBoxStyleProperty

Field Value

DependencyProperty

TextSearchModeProperty

Identifies the TextSearchMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextSearchModeProperty

Field Value

DependencyProperty

TextSearchPathProperty

Identifies the TextSearchPath dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextSearchPathProperty

Field Value

DependencyProperty

WatermarkContentProperty

Identifies the WatermarkContent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WatermarkContentProperty

Field Value

DependencyProperty

Properties

AutoCompleteMode

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

Declaration

cs-api-definition
public AutoCompleteMode AutoCompleteMode { get; set; }

Property Value

AutoCompleteMode

BoxesItemStyle

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

Declaration

cs-api-definition
public Style BoxesItemStyle { get; set; }

Property Value

Style

BoxesItemStyleSelector

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.

Declaration

cs-api-definition
public StyleSelector BoxesItemStyleSelector { get; set; }

Property Value

StyleSelector

BoxesItemTemplate

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

Declaration

cs-api-definition
public DataTemplate BoxesItemTemplate { get; set; }

Property Value

DataTemplate

BoxesItemTemplateSelector

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.

Declaration

cs-api-definition
public DataTemplateSelector BoxesItemTemplateSelector { get; set; }

Property Value

DataTemplateSelector

DisplayMemberPath

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.

Declaration

cs-api-definition
public string DisplayMemberPath { get; set; }

Property Value

string

DropDownItemTemplate

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

Declaration

cs-api-definition
public DataTemplate DropDownItemTemplate { get; set; }

Property Value

DataTemplate

DropDownItemTemplateSelector

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.

Declaration

cs-api-definition
public DataTemplateSelector DropDownItemTemplateSelector { get; set; }

Property Value

DataTemplateSelector

DropDownPlacement

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

Declaration

cs-api-definition
public AutoCompleteDropDownPlacement DropDownPlacement { get; set; }

Property Value

AutoCompleteDropDownPlacement

DropDownWidth

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

Declaration

cs-api-definition
public GridLength DropDownWidth { get; set; }

Property Value

GridLength

FilteredItems

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

Declaration

cs-api-definition
public IEnumerable FilteredItems { get; }

Property Value

IEnumerable

FilteringBehavior

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

Declaration

cs-api-definition
public IFilteringBehavior FilteringBehavior { get; set; }

Property Value

IFilteringBehavior

HighlightBehavior

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

Declaration

cs-api-definition
public IHighlightBehavior HighlightBehavior { get; set; }

Property Value

IHighlightBehavior

HighlightedIndex

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

Declaration

cs-api-definition
protected int HighlightedIndex { get; set; }

Property Value

int

IsDropDownOpen

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

Declaration

cs-api-definition
public bool IsDropDownOpen { get; set; }

Property Value

bool

IsHighlighted

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

Declaration

cs-api-definition
public bool IsHighlighted { get; set; }

Property Value

bool

ItemsSource

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

Declaration

cs-api-definition
public IEnumerable ItemsSource { get; set; }

Property Value

IEnumerable

MaxDropDownHeight

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

Declaration

cs-api-definition
public double MaxDropDownHeight { get; set; }

Property Value

double

MaxDropDownWidth

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

Declaration

cs-api-definition
public double MaxDropDownWidth { get; set; }

Property Value

double

MinDropDownWidth

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

Declaration

cs-api-definition
public double MinDropDownWidth { get; set; }

Property Value

double

NoResultsContent

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

Declaration

cs-api-definition
public object NoResultsContent { get; set; }

Property Value

object

NoResultsContentTemplate

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

Declaration

cs-api-definition
public DataTemplate NoResultsContentTemplate { get; set; }

Property Value

DataTemplate

SearchText

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.

Declaration

cs-api-definition
public string SearchText { get; set; }

Property Value

string

SelectedItem

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

Declaration

cs-api-definition
public object SelectedItem { get; set; }

Property Value

object

SelectedItems

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

Declaration

cs-api-definition
public IEnumerable SelectedItems { get; set; }

Property Value

IEnumerable

SelectionMode

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

Declaration

cs-api-definition
public AutoCompleteSelectionMode SelectionMode { get; set; }

Property Value

AutoCompleteSelectionMode

TextBoxStyle

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

Declaration

cs-api-definition
public Style TextBoxStyle { get; set; }

Property Value

Style

TextSearchMode

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

Declaration

cs-api-definition
public TextSearchMode TextSearchMode { get; set; }

Property Value

TextSearchMode

TextSearchPath

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.

Declaration

cs-api-definition
public string TextSearchPath { get; set; }

Property Value

string

WatermarkContent

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.

Declaration

cs-api-definition
public object WatermarkContent { get; set; }

Property Value

object

Methods

Dispose()

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

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly")]
[SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "popupWrapper")]
[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
[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()

GoToState(bool)

Updates the visual state of the control.

Declaration

cs-api-definition
protected void GoToState(bool useTransition)

Parameters

useTransition

bool

Indicates whether transition should be used.

HandleKeyDown(Key)

Contains the keyboard navigation logic of RadAutoCompleteBox.

Declaration

cs-api-definition
protected virtual bool HandleKeyDown(Key systemKey)

Parameters

systemKey

Key

The key that has been pressed.

Returns

bool

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

OnApplyTemplate()

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

Declaration

cs-api-definition
public override void OnApplyTemplate()

OnAutoCompleteModeChanged(AutoCompleteMode)

Called when the AutoCompleteMode property is changed.

Declaration

cs-api-definition
protected virtual void OnAutoCompleteModeChanged(AutoCompleteMode newValue)

Parameters

newValue

AutoCompleteMode

OnCreateAutomationPeer()

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

Declaration

cs-api-definition
protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

The type-specific AutomationPeer implementation.

OnDisplayMemberPathChanged()

Called when the DisplayMemberPath property is changed.

Declaration

cs-api-definition
protected virtual void OnDisplayMemberPathChanged()

OnFilteringBehaviorChanged()

Called when the FilteringBehavior property is changed.

Declaration

cs-api-definition
protected virtual void OnFilteringBehaviorChanged()

OnGotFocus(RoutedEventArgs)

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

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

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.

Declaration

cs-api-definition
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)

Parameters

e

KeyboardFocusChangedEventArgs

OnHighlightBehaviorChanged()

Called when the HighlightBehavior property is changed.

Declaration

cs-api-definition
protected virtual void OnHighlightBehaviorChanged()

OnInitialized(EventArgs)

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

Declaration

cs-api-definition
protected override void OnInitialized(EventArgs e)

Parameters

e

EventArgs

The RoutedEventArgs that contains the event data.

OnIsDropDownOpenChanged(bool)

Called when the IsDropDownOpen property is changed.

Declaration

cs-api-definition
protected virtual void OnIsDropDownOpenChanged(bool isOpen)

Parameters

isOpen

bool

OnIsHighlightedChanged()

Called when the IsHighlighted property is changed.

Declaration

cs-api-definition
protected virtual void OnIsHighlightedChanged()

OnItemsSourceChanged(object, object)

Called when the ItemsSource property is changed.

Declaration

cs-api-definition
protected virtual void OnItemsSourceChanged(object newValue, object oldValue)

Parameters

newValue

object

oldValue

object

OnLostFocus(RoutedEventArgs)

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

Declaration

cs-api-definition
protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

OnMouseWheel(MouseWheelEventArgs)

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

Declaration

cs-api-definition
protected override void OnMouseWheel(MouseWheelEventArgs e)

Parameters

e

MouseWheelEventArgs

A MouseWheelEventArgs that contains the event data.

OnSelectedItemChanged(object)

Called when the SelectedItem property is changed.

Declaration

cs-api-definition
protected virtual void OnSelectedItemChanged(object newValue)

Parameters

newValue

object

OnSelectedItemsChanged(IEnumerable)

Called when the SelectedItems property is changed.

Declaration

cs-api-definition
protected virtual void OnSelectedItemsChanged(IEnumerable newValue)

Parameters

newValue

IEnumerable

OnSelectionChanged(SelectionChangedEventArgs)

Called when the selection changes.

Declaration

cs-api-definition
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)

Parameters

e

SelectionChangedEventArgs

The event data.

OnSelectionModeChanged(AutoCompleteSelectionMode)

Called when the SelectionMode property is changed.

Declaration

cs-api-definition
protected virtual void OnSelectionModeChanged(AutoCompleteSelectionMode newValue)

Parameters

newValue

AutoCompleteSelectionMode

OnTextBoxStyleChanged()

Called when the TextBoxStyle property is changed.

Declaration

cs-api-definition
protected virtual void OnTextBoxStyleChanged()

OnTextSearchModeChanged(TextSearchMode)

Called when the TextSearchMode property is changed.

Declaration

cs-api-definition
protected virtual void OnTextSearchModeChanged(TextSearchMode textSearchMode)

Parameters

textSearchMode

TextSearchMode

OnTextSearchPathChanged()

Called when the TextSearchPath property is changed.

Declaration

cs-api-definition
protected virtual void OnTextSearchPathChanged()

OnWatermarkContentChanged()

Called when the WatermarkContent property is changed.

Declaration

cs-api-definition
protected virtual void OnWatermarkContentChanged()

Populate(string)

Searches through the AutoCompleteBox Items with the specified string input.

Declaration

cs-api-definition
public void Populate(string searchText)

Parameters

searchText

string

The string used to search in the AutoCompleteBox.

Events

Populated

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

Declaration

cs-api-definition
public event EventHandler Populated

Event Value

EventHandler

Populating

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

Declaration

cs-api-definition
public event EventHandler<CancelRoutedEventArgs> Populating

Event Value

EventHandler<CancelRoutedEventArgs>

SearchTextChanged

Occurs when SearchText property changes.

Declaration

cs-api-definition
public event EventHandler SearchTextChanged

Event Value

EventHandler

SelectionChanged

Occurs when the selection of the RadAutoCompleteBox changes.

Declaration

cs-api-definition
public event SelectionChangedEventHandler SelectionChanged

Event Value

SelectionChangedEventHandler

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