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

Builds and filters the path suggestions shown while editing a breadcrumb.

Definition

Namespace:Telerik.WinControls.UI.BreadCrumb

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class BreadCrumbAutoCompleteSuggestHelper : IDisposable

Inheritance: objectBreadCrumbAutoCompleteSuggestHelper

Implements: IDisposable

Constructors

Creates a suggestion helper for a breadcrumb editor and attaches its drop-down list to the editor.

C#
public BreadCrumbAutoCompleteSuggestHelper(RadTextBoxElement owner, RadBreadCrumbElement breadCrumb)
Parameters:ownerRadTextBoxElement

The text-box element that receives the edited path.

breadCrumbRadBreadCrumbElement

The breadcrumb element whose tree supplies path suggestions.

Properties

Gets or sets the object that is responsible for providing data objects for the AutoComplete Suggest.

C#
public virtual object AutoCompleteDataSource { get; set; }

Gets or sets the member name used by the suggestion list to display each data-bound item.

C#
public virtual string AutoCompleteDisplayMember { get; set; }

Gets or sets the member name used by the suggestion list to obtain each data-bound item's value.

C#
public virtual string AutoCompleteValueMember { get; set; }

DropDownList Property

C#
public virtual BreadCrumbAutoCompleteSuggestDropDownListElement DropDownList { get; set; }

Gets the normalized path fragment currently used to filter suggestions.

C#
protected virtual string Filter { get; }

IsItemsDirty Property

C#
public virtual bool IsItemsDirty { get; }

Owner Property

C#
public RadTextBoxElement Owner { get; }

Gets the string comparison rule used to match suggestion paths; it is synchronized with the breadcrumb before filtering.

C#
protected virtual StringComparison StringComparison { get; }

Gets or sets whether suggestions match the current filter at the start of a node path or anywhere in the path. The default mode matches paths that start with the filter.

C#
public SuggestMode SuggestMode { get; set; }

Methods

Removes a leading path separator from the filter, applies the node-path match, and sorts suggestions in ascending order.

C#
public virtual void ApplyFilterToDropDown(string filter)
Parameters:filterstring

The path fragment used to filter the suggestion list.

Processes a key pressed in the breadcrumb editor, updates the path being parsed, and refreshes its suggestions. Escape is ignored, while Enter returns focus to the editor.

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

The key press and character data from the editor.

Searches in the requested direction for an enabled suggestion and keeps the original index if none is found.

C#
protected virtual int ClampSelectedIndex(bool down, int selectedIndex, int itemsCount)
Parameters:downbool

true to search toward higher indexes; otherwise, search toward lower indexes.

selectedIndexint

The index from which to begin searching.

itemsCountint

The number of suggestion items that bounds the forward search.

Returns:

int

The next enabled item's index, or selectedIndex if none is found.

Marks unbound suggestion items as needing synchronization after a collection change; ignores notifications raised during helper updates.

C#
public virtual void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters:senderobject

The object that raised the collection change.

eNotifyCollectionChangedEventArgs

Details about the collection change.

Creates the drop-down list element used to display suggestions.

C#
protected virtual BreadCrumbAutoCompleteSuggestDropDownListElement CreateDropDownElement()
Returns:

BreadCrumbAutoCompleteSuggestDropDownListElement

A new suggestion list associated with this helper.

Tests the associated node's full path against the active filter using the configured suggestion mode and comparison.

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

A list item backed by a breadcrumb autocomplete item with an associated node.

Returns:

bool

true if the node path matches the filter; otherwise, false.

Removes and disposes the suggestion list attached to the editor and clears its data source.

C#
public virtual void Dispose()

Implements: IDisposable.Dispose()

Filters suggestions and closes the popup for an empty filter, no matches, or a single exact match; otherwise, opens it.

C#
public virtual void HandleAutoSuggest(string filter)
Parameters:filterstring

The path fragment used to match candidate node paths.

Moves the selected suggestion to the next or previous enabled item, leaving it unchanged if none is available.

C#
public virtual void HandleSelectNextOrPrev(bool next)
Parameters:nextbool

true to move toward higher indexes; otherwise, move toward lower indexes.

Raises the breadcrumb event after candidate suggestion items have been created.

C#
protected virtual void OnAutoCompleteItemsCreated(object sender, AutoCompleteItemsCreatedEventArgs args)
Parameters:senderobject

The source of the event.

argsAutoCompleteItemsCreatedEventArgs

The candidate items that can be adjusted before binding.

Raises the breadcrumb event that can adjust the path before it is parsed for suggestions.

C#
protected virtual void OnAutoCompleteItemsCreating(object sender, AutoCompleteItemsCreatingEventArgs args)
Parameters:senderobject

The source of the event.

argsAutoCompleteItemsCreatingEventArgs

The path that can be adjusted before parsing.

Returns the editor text that would result from inserting the pressed character at the caret or replacing the selection. This method does not change the editor text.

C#
public virtual string SetFindString(KeyPressEventArgs e)
Parameters:eKeyPressEventArgs

The key press whose character is inserted into the resulting text.

Returns:

string

The path text after applying the key press.

Returns the editor text that would remain after a Backspace removes the selected text or character before the caret. This method does not change the editor text.

C#
public virtual string SetFindStringFromBack()
Returns:

string

The path text after applying the Backspace edit.

Opens the suggestion popup, clears the suggestion selection, and preserves the editor's caret and selection range.

C#
public virtual void ShowDropDownList()

Ends the current edit and synchronizes the breadcrumb with the selected suggestion's associated node, when present.

C#
protected void SynchronizeOwnerSelection(RadListDataItem item)
Parameters:itemRadListDataItem

The selected suggestion item, or null to end editing without selecting a node.

Rebuilds suggestion items when they are marked dirty by calling SyncItemsCore().

C#
protected virtual void SyncItems()

Provides the override point for rebuilding the suggestion list; the base implementation does not populate the list.

C#
protected virtual void SyncItemsCore()

Parses the selected suggestion's text and updates the editor text when it is a valid breadcrumb path.

C#
protected virtual void SyncOwnerElementWithSelectedIndex()