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:
[TelerikToolboxCategory("Input")]
[Themable]
public class RadAutoCompleteBox : Control, IDisposable
Inheritance: objectRadAutoCompleteBox
Implements:
Constructors
Initializes a new instance of the RadAutoCompleteBox class.
public RadAutoCompleteBox()
Fields
AutoCompleteModeProperty
DependencyProperty
Identifies the AutoCompleteMode dependency property.
public static readonly DependencyProperty AutoCompleteModeProperty
BoxesItemStyleProperty
DependencyProperty
Identifies the BoxesItemStyle dependency property.
public static readonly DependencyProperty BoxesItemStyleProperty
BoxesItemStyleSelectorProperty
DependencyProperty
Identifies the BoxesItemStyleSelector dependency property.
public static readonly DependencyProperty BoxesItemStyleSelectorProperty
BoxesItemTemplateProperty
DependencyProperty
Identifies the BoxesItemTemplate dependency property.
public static readonly DependencyProperty BoxesItemTemplateProperty
BoxesItemTemplateSelectorProperty
DependencyProperty
Identifies the BoxesItemTemplateSelector dependency property.
public static readonly DependencyProperty BoxesItemTemplateSelectorProperty
DisplayMemberPathProperty
DependencyProperty
Identifies the DisplayMemberPath dependency property.
public static readonly DependencyProperty DisplayMemberPathProperty
DropDownItemTemplateProperty
DependencyProperty
Identifies the DropDownItemTemplate dependency property.
public static readonly DependencyProperty DropDownItemTemplateProperty
DropDownItemTemplateSelectorProperty
DependencyProperty
Identifies the DropDownItemTemplateSelector dependency property.
public static readonly DependencyProperty DropDownItemTemplateSelectorProperty
DropDownPlacementProperty
DependencyProperty
Identifies the DropDownPlacement dependency property.
public static readonly DependencyProperty DropDownPlacementProperty
DropDownWidthProperty
DependencyProperty
Identifies the DropDownWidth dependency property.
public static readonly DependencyProperty DropDownWidthProperty
FilteredItemsProperty
DependencyProperty
Identifies the MaxDropDownWidthProperty dependency property.
public static readonly DependencyProperty FilteredItemsProperty
FilteringBehaviorProperty
DependencyProperty
Identifies the FilteringBehavior dependency property.
public static readonly DependencyProperty FilteringBehaviorProperty
HighlightBehaviorProperty
DependencyProperty
Identifies the HighlightBehavior dependency property.
public static readonly DependencyProperty HighlightBehaviorProperty
IsDropDownOpenProperty
DependencyProperty
Identifies the IsDropDownOpen dependency property.
public static readonly DependencyProperty IsDropDownOpenProperty
IsHighlightedProperty
DependencyProperty
Identifies the IsHighlighted dependency property.
public static readonly DependencyProperty IsHighlightedProperty
ItemsSourceProperty
DependencyProperty
Identifies the ItemsSource dependency property.
public static readonly DependencyProperty ItemsSourceProperty
MaxDropDownHeightProperty
DependencyProperty
Identifies the MaxDropDownHeight dependency property.
public static readonly DependencyProperty MaxDropDownHeightProperty
MaxDropDownWidthProperty
DependencyProperty
Identifies the MaxDropDownWidthProperty dependency property.
public static readonly DependencyProperty MaxDropDownWidthProperty
MinDropDownWidthProperty
DependencyProperty
Identifies the MinDropDownWidthProperty dependency property.
public static readonly DependencyProperty MinDropDownWidthProperty
NoResultsContentProperty
DependencyProperty
Identifies the NoResultsContent dependency property.
public static readonly DependencyProperty NoResultsContentProperty
NoResultsContentTemplateProperty
DependencyProperty
Identifies the NoResultsContentTemplate dependency property.
public static readonly DependencyProperty NoResultsContentTemplateProperty
SearchTextProperty
DependencyProperty
Identifies the MaxDropDownWidthProperty dependency property.
public static readonly DependencyProperty SearchTextProperty
SelectedItemProperty
DependencyProperty
Identifies the SelectedItem dependency property.
public static readonly DependencyProperty SelectedItemProperty
SelectedItemsProperty
DependencyProperty
Identifies the SelectedItems dependency property.
public static readonly DependencyProperty SelectedItemsProperty
SelectionChangedEvent
RoutedEvent
Occurs when the selection of a RadAutoCompleteBox changes.
public static readonly RoutedEvent SelectionChangedEvent
SelectionModeProperty
DependencyProperty
Identifies the SelectionMode dependency property.
public static readonly DependencyProperty SelectionModeProperty
TextBoxStyleProperty
DependencyProperty
Identifies the TextBoxStyle dependency property.
public static readonly DependencyProperty TextBoxStyleProperty
TextSearchModeProperty
DependencyProperty
Identifies the TextSearchMode dependency property.
public static readonly DependencyProperty TextSearchModeProperty
TextSearchPathProperty
DependencyProperty
Identifies the TextSearchPath dependency property.
public static readonly DependencyProperty TextSearchPathProperty
WatermarkContentProperty
DependencyProperty
Identifies the WatermarkContent dependency property.
public static readonly DependencyProperty WatermarkContentProperty
Properties
Specifies the autocomplete mode for the RadAutoCompleteBox. This is a dependency property.
public AutoCompleteMode AutoCompleteMode { get; set; }
BoxesItemStyle
Style
Gets or sets the System.Windows.Style used to display each item into the boxes part of the control. This is a dependency property.
public Style BoxesItemStyle { get; set; }
BoxesItemStyleSelector
StyleSelector
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.
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.
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.
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.
public string DisplayMemberPath { get; set; }
DropDownItemTemplate
DataTemplate
Gets or sets the System.Windows.DataTemplate used to display each item into the DropDown part of the control. This is a dependency property.
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.
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.
public AutoCompleteDropDownPlacement DropDownPlacement { get; set; }
DropDownWidth
GridLength
Gets or sets a GridLength that indicates what the RadAutoCompleteBox' DropDown width will be.
public GridLength DropDownWidth { get; set; }
Gets the currently filtered items into the RadAutoCompleteBox. This is a dependency property.
public IEnumerable FilteredItems { get; }
Gets or sets the FilteringBehavior of the RadAutoCompleteBox. This is a dependency property.
public IFilteringBehavior FilteringBehavior { get; set; }
Gets or sets the HighlightBehavior of the RadAutoCompleteBox. This is a dependency property.
public IHighlightBehavior HighlightBehavior { get; set; }
Gets or sets the currently highlighted index in the dropdown portion of the control.
protected int HighlightedIndex { get; set; }
Gets or sets the value that indicates whether the RadAutoCompleteBox dropdown is currently open. This is a dependency property.
public bool IsDropDownOpen { get; set; }
Gets or sets a value indicating whether this instance is highlighted. This is a dependency property.
public bool IsHighlighted { get; set; }
Gets or sets a collection that is filtered when the user enters text. This is a dependency property.
public IEnumerable ItemsSource { get; set; }
Gets or sets the maximum height for a RadAutoCompleteBox drop-down. This is a dependency property.
public double MaxDropDownHeight { get; set; }
Gets or sets the maximum width of a RadAutoCompleteBox drop-down. This is a dependency property.
public double MaxDropDownWidth { get; set; }
Gets or sets the minimum width of a RadAutoCompleteBox drop-down. This is a dependency property.
public double MinDropDownWidth { get; set; }
Gets or sets the content displayed in the dropdown if the filter result is empty.
public object NoResultsContent { get; set; }
NoResultsContentTemplate
DataTemplate
Gets or sets the System.Windows.DataTemplate used to display the content in the dropdown if the filter result is empty.
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.
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.
public object SelectedItem { get; set; }
Gets or sets the list of currently selected items for the RadAutoCompleteBox. This is a dependency property.
public IEnumerable SelectedItems { get; set; }
Specifies the selection mode for the RadAutoCompleteBox. This is a dependency property.
public AutoCompleteSelectionMode SelectionMode { get; set; }
TextBoxStyle
Style
Gets or sets the style of the RadWatermarkTextBox into the RadAutoCompleteBox. This is a dependency property.
public Style TextBoxStyle { get; set; }
Specifies the text search mode for the RadAutoCompleteBox. This is a dependency property.
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.
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.
public object WatermarkContent { get; set; }
Methods
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
[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:
Updates the visual state of the control.
protected void GoToState(bool useTransition)
Indicates whether transition should be used.
Contains the keyboard navigation logic of RadAutoCompleteBox.
protected virtual bool HandleKeyDown(Key systemKey)
The key that has been pressed.
Returns: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 .
public override void OnApplyTemplate()
Called when the AutoCompleteMode property is changed.
protected virtual void OnAutoCompleteModeChanged(AutoCompleteMode newValue)
OnCreateAutomationPeer()
AutomationPeer
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
The type-specific AutomationPeer implementation.
Called when the DisplayMemberPath property is changed.
protected virtual void OnDisplayMemberPathChanged()
Called when the FilteringBehavior property is changed.
protected virtual void OnFilteringBehaviorChanged()
Called before the System.Windows.UIElement.GotFocus event occurs.
protected override void OnGotFocus(RoutedEventArgs e)
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.
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Called when the HighlightBehavior property is changed.
protected virtual void OnHighlightBehaviorChanged()
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Called when the IsDropDownOpen property is changed.
Called when the IsHighlighted property is changed.
protected virtual void OnIsHighlightedChanged()
Called before the System.Windows.UIElement.LostFocus event occurs.
protected override void OnLostFocus(RoutedEventArgs e)
Called before the event occurs to provide handling for the event in a derived class without attaching a delegate.
protected override void OnMouseWheel(MouseWheelEventArgs e)
A MouseWheelEventArgs that contains the event data.
Called when the SelectedItem property is changed.
Called when the SelectedItems property is changed.
protected virtual void OnSelectedItemsChanged(IEnumerable newValue)
Called when the selection changes.
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
The event data.
Called when the SelectionMode property is changed.
protected virtual void OnSelectionModeChanged(AutoCompleteSelectionMode newValue)
Called when the TextBoxStyle property is changed.
protected virtual void OnTextBoxStyleChanged()
Called when the TextSearchMode property is changed.
protected virtual void OnTextSearchModeChanged(TextSearchMode textSearchMode)
Called when the TextSearchPath property is changed.
protected virtual void OnTextSearchPathChanged()
Called when the WatermarkContent property is changed.
protected virtual void OnWatermarkContentChanged()
Searches through the AutoCompleteBox Items with the specified string input.
public void Populate(string searchText)
The string used to search in the AutoCompleteBox.
Events
Occurs when the filtering of the RadAutoCompleteBox is finished and the FilteredItems are populated.
public event EventHandler Populated
Populating
EventHandler<CancelRoutedEventArgs>
Occurs before the RadAutoCompleteBox' items are filtered using the current SearchText.
public event EventHandler<CancelRoutedEventArgs> Populating
Occurs when SearchText property changes.
public event EventHandler SearchTextChanged
SelectionChanged
SelectionChangedEventHandler
Occurs when the selection of the RadAutoCompleteBox changes.
public event SelectionChangedEventHandler SelectionChanged