New to Telerik UI for WinForms? Start a free 30-day trial

Implements prefix-based autocomplete that completes the editable text from matching list items.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class AutoCompleteAppendHelper : BaseAutoComplete, IDisposable

Inheritance: objectBaseAutoCompleteAutoCompleteAppendHelper

Derived Classes: RadDropDownListEditorAutoCompleteAppendHelper

Implements: IDisposable

Inherited Members BaseAutoComplete.Dispose()BaseAutoComplete.Owner

Constructors

Initializes the autocomplete helper for the specified drop-down list.

C#
public AutoCompleteAppendHelper(RadDropDownListElement owner)
Parameters:ownerRadDropDownListElement

The drop-down list whose items and editable text are used for completion.

Properties

Gets the text currently being matched against the list items.

C#
protected string FindString { get; }

LimitToList Property

C#
public bool LimitToList { get; set; }

Gets the comparison mode used for prefix matching, based on the owner's case-sensitivity setting.

C#
protected StringComparison StringComparison { get; }

Methods

Completes the editor text from a matching item, or optionally prevents a character that would leave the list.

C#
public void AutoComplete(KeyPressEventArgs e, bool limitToList)
Parameters:eKeyPressEventArgs

The key press to process.

limitToListbool

true to mark an unmatched character as handled, except for Backspace; otherwise, allow unmatched input.

Processes a key press using the current LimitToList setting.

C#
public override void AutoComplete(KeyPressEventArgs e)
Parameters:eKeyPressEventArgs

The key press to process as autocomplete input.

Overrides: BaseAutoComplete.AutoComplete(KeyPressEventArgs)

Determines whether an item's cached text starts with the current find string.

C#
protected virtual bool DefaultCompare(RadListDataItem item)
Parameters:itemRadListDataItem

The list item to compare.

Returns:

bool

true when the item's cached text has the current prefix; otherwise, false.

Finds an enabled item whose cached text starts with the specified string, preferring an exact-length match.

C#
public virtual int FindShortestString(string findString)
Parameters:findStringstring

The prefix to match against item cached text.

Returns:

int

The row index of an exact match, or the first longer match in the sorted cached-text order; otherwise, -1.

Finds a prefix match and updates the editor text, selecting the unmatched suffix when a match is found.

C#
public virtual void SearchForStringInList(string findString)
Parameters:findStringstring

The text to match at the beginning of an enabled item's cached text.

Copies the cached text of the specified owner item into the editable area.

C#
protected virtual void SetEditableElementText(int itemIndex)
Parameters:itemIndexint

The index of the item whose text is copied.