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

This class presents a behavior for the autocomplete used in the ItemsControls.

Definition

Namespace:Telerik.Windows.Controls.Primitives

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class AutocompleteBehavior

Inheritance: objectAutocompleteBehavior

Constructors

Initializes a new instance of the AutocompleteBehavior class.

C#
public AutocompleteBehavior()

Properties

Gets or sets a value indicating whether a custom text is allowed.

C#
public bool AllowCustomText { get; set; }

Gets or sets the autocomplete timeout. When the timeout is over, the typed text for the autocomplete is reset.

C#
public static TimeSpan AutoCompleteTimeout { get; set; }

Gets the current text that is used for the autocomplete.

C#
public string CurrentText { get; }

Gets or sets whether the item associated with the index is selectable.

C#
public Func<int, bool> IsIndexSelectable { get; set; }

Gets or sets the ItemSearch for the autocomplete. The IItemSearchControl object defines the logic how the items are found with the retrievers.

C#
public IItemSearchControl ItemSearch { get; set; }

Gets the last length of the selection.

C#
protected int LastSelectionLength { get; }

Gets the last selection start.

C#
protected int LastSelectionStart { get; }

Gets the last text that is set.

C#
protected string LastText { get; }

Gets the matching item.

C#
public object MatchingItem { get; }

Gets or sets the text Retriever that is used for autocomplete.

C#
public IValueRetriever TextRetriever { get; set; }

Gets or sets the text search mode. Specifies how TextSearch will match items.

C#
public TextSearchMode TextSearchMode { get; set; }
Property Value:

The text search mode.

Gets or sets the text source.

C#
public ITextSource TextSource { get; set; }

Methods

Extracts the current text from the current selection to its length.

C#
protected virtual string ExtractCurrentText()
Returns:

string

Determines whether the matched item is found with full match or not.

C#
public bool IsFullMatch(object item)
Parameters:itemobject

The item.

Returns:

bool

Sets a current text for the autocomplete.

C#
public bool SetCurrentText(string text)
Parameters:textstring

The text.

Returns:

bool

This property is used to detect whether the test source selection change is detected or not.

C#
protected bool TextSourceSelectionChangeDetected()
Returns:

bool

This property is used to detect whether the test source text change is detected or not.

C#
protected bool TextSourceTextChangeDetected()
Returns:

bool

Updates the current text.

C#
protected bool UpdateCurrentText()
Returns:

bool

Updates the text source according the current and matching item text.

C#
protected virtual void UpdateTextSource(string text, string matchingItemText)
Parameters:textstring

The current text.

matchingItemTextstring

The matching item text.

Updates the text source state cache.

C#
protected virtual void UpdateTextSourceStateCache()

Events

Occurs when current text is changed.

C#
public event EventHandler CurrentTextChanged

Occurs when matching item is changed.

C#
public event EventHandler MatchingItemChanged