Builds and filters the path suggestions shown while editing a breadcrumb.
Definition
Namespace:Telerik.WinControls.UI.BreadCrumb
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class BreadCrumbAutoCompleteSuggestHelper : IDisposable
Inheritance: objectBreadCrumbAutoCompleteSuggestHelper
Implements:
Constructors
Creates a suggestion helper for a breadcrumb editor and attaches its drop-down list to the editor.
public BreadCrumbAutoCompleteSuggestHelper(RadTextBoxElement owner, RadBreadCrumbElement breadCrumb)
The text-box element that receives the edited path.
breadCrumbRadBreadCrumbElementThe breadcrumb element whose tree supplies path suggestions.
Properties
Gets or sets the object that is responsible for providing data objects for the AutoComplete Suggest.
public virtual object AutoCompleteDataSource { get; set; }
Gets or sets the member name used by the suggestion list to display each data-bound item.
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.
public virtual string AutoCompleteValueMember { get; set; }
DropDownList Property
public virtual BreadCrumbAutoCompleteSuggestDropDownListElement DropDownList { get; set; }
Gets the normalized path fragment currently used to filter suggestions.
protected virtual string Filter { get; }
IsItemsDirty Property
public virtual bool IsItemsDirty { get; }
Owner Property
public RadTextBoxElement Owner { get; }
Gets the string comparison rule used to match suggestion paths; it is synchronized with the breadcrumb before filtering.
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.
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.
public virtual void ApplyFilterToDropDown(string filter)
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.
public virtual void AutoComplete(KeyPressEventArgs e)
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.
protected virtual int ClampSelectedIndex(bool down, int selectedIndex, int itemsCount)
true to search toward higher indexes; otherwise, search toward lower indexes.
selectedIndexintThe index from which to begin searching.
itemsCountintThe number of suggestion items that bounds the forward search.
Returns: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.
public virtual void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
The object that raised the collection change.
eNotifyCollectionChangedEventArgsDetails about the collection change.
Creates the drop-down list element used to display suggestions.
protected virtual BreadCrumbAutoCompleteSuggestDropDownListElement CreateDropDownElement()
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.
protected virtual bool DefaultFilter(RadListDataItem item)
A list item backed by a breadcrumb autocomplete item with an associated node.
Returns:Removes and disposes the suggestion list attached to the editor and clears its data source.
public virtual void Dispose()
Implements:
Filters suggestions and closes the popup for an empty filter, no matches, or a single exact match; otherwise, opens it.
public virtual void HandleAutoSuggest(string filter)
The path fragment used to match candidate node paths.
Raises the breadcrumb event after candidate suggestion items have been created.
protected virtual void OnAutoCompleteItemsCreated(object sender, AutoCompleteItemsCreatedEventArgs args)
The source of the event.
argsAutoCompleteItemsCreatedEventArgsThe candidate items that can be adjusted before binding.
Raises the breadcrumb event that can adjust the path before it is parsed for suggestions.
protected virtual void OnAutoCompleteItemsCreating(object sender, AutoCompleteItemsCreatingEventArgs args)
The source of the event.
argsAutoCompleteItemsCreatingEventArgsThe 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.
public virtual string SetFindString(KeyPressEventArgs e)
The key press whose character is inserted into the resulting text.
Returns: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.
public virtual string SetFindStringFromBack()
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.
public virtual void ShowDropDownList()
Ends the current edit and synchronizes the breadcrumb with the selected suggestion's associated node, when present.
protected void SynchronizeOwnerSelection(RadListDataItem item)
The selected suggestion item, or null to end editing without selecting a node.
Rebuilds suggestion items when they are marked dirty by calling SyncItemsCore().
protected virtual void SyncItems()
Provides the override point for rebuilding the suggestion list; the base implementation does not populate the list.
protected virtual void SyncItemsCore()
Parses the selected suggestion's text and updates the editor text when it is a valid breadcrumb path.
protected virtual void SyncOwnerElementWithSelectedIndex()