BaseComboBoxElement
Represents a combo box element.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[ComVisible(false)]
[LookupBindingProperties("DataSource", "DisplayMember", "ValueMember", "SelectedValue")]
public abstract class BaseComboBoxElement : PopupEditorBaseElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IInputEditor, IValueEditor, ISupportInitialize
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadEditorElementEditorBaseElementPopupEditorBaseElementBaseComboBoxElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new BaseComboBoxElement and fits it to the available size.
public BaseComboBoxElement()
Fields
Identifies the property that tracks whether the drop-down popup is open and propagates that state to child elements.
public static RadProperty IsDropDownShownProperty
The most recent character received by the editor's key-press handler, available to derived autocomplete implementations.
protected char lastPressedChar
The latest editor text captured by ProcessTextChanged(object, EventArgs) while an editable text change is being processed.
protected string LastTypedText
The layout panel that arranges the editor content and drop-down arrow.
protected ComboBoxEditorLayoutPanel layoutPanel
textBox
RadTextBoxItem
The hosted text item used by derived combo-box elements to access editor text and selection state.
protected RadTextBoxItem textBox
Properties
Gets the arrow button element.
public RadArrowButtonElement ArrowButton { get; }
Gets or sets the arrow button's minimum width without changing its current minimum height.
public int ArrowButtonMinWidth { get; set; }
Specifies the mode for the automatic completion feature used in the ComboBox and the TextBox controls.
[Browsable(true)]
public virtual AutoCompleteMode AutoCompleteMode { get; set; }
Gets or set the value in Milliseconds indicating delay between last key press and filtering operation
public int AutoFilterDelay { get; set; }
Gets or sets a value indicating whether string comparisons are case-sensitive.
[Browsable(true)]
public bool CaseSensitive { get; set; }
Gets the border element.
public BorderPrimitive ComboBoxBorder { get; }
Gets the fill element.
public FillPrimitive ComboBoxFill { get; }
Gets or sets the data source.
public abstract object DataSource { get; set; }
Rotate items on double click in the edit box part
[Browsable(true)]
public bool DblClickRotate { get; set; }
Gets or sets the property to display.
[TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public abstract string DisplayMember { get; set; }
Gets or sets the type of the DropDown animation.
[Browsable(true)]
public RadEasingType DropDownAnimationEasing { get; set; }
Gets or sets a value indicating whether the ComboBox DropDown will be enabled when it shows.
[Browsable(true)]
public bool DropDownAnimationEnabled { get; set; }
Gets or sets the number of frames that will be used when the DropDown is being animated.
[Browsable(true)]
public int DropDownAnimationFrames { get; set; }
Gets or sets the height in pixels of the drop-down portion of the ComboBox.
[Browsable(true)]
public int DropDownHeight { get; set; }
Gets or sets the maximum size applied to a resizable drop-down popup. Empty means no explicit maximum; a non-empty maximum smaller than the current minimum reduces the corresponding minimum dimensions.
[Browsable(true)]
public Size DropDownMaxSize { get; set; }
Gets or sets the minimum size applied when a resizable drop-down popup is shown. If a non-empty maximum is smaller, setting this property raises the corresponding maximum dimensions to match.
[Browsable(true)]
public Size DropDownMinSize { get; set; }
Gets or sets which sizing grips are enabled for the drop-down popup.
[Browsable(true)]
public abstract SizingMode DropDownSizingMode { get; set; }
Gets or sets a value specifying the style of the combo box.
[Browsable(true)]
public RadDropDownStyle DropDownStyle { get; set; }
Gets or sets the width of the of the drop-down portion of a combo box.
[Browsable(true)]
public int DropDownWidth { get; set; }
Gets or sets the IFormatProvider that provides custom formatting behavior.
[Browsable(false)]
public abstract IFormatProvider FormatInfo { get; set; }
Gets or sets the format-specifier characters that indicate how a value is to be displayed.
public abstract string FormatString { get; set; }
Gets or sets a value indicating whether formatting is applied to the DisplayMember property.
public abstract bool FormattingEnabled { get; set; }
Gets or sets whether a selection-index update is in progress; text-change processing skips autocomplete tracking while this is true.
protected abstract bool IndexChanging { get; set; }
Gets or sets a value indicating whether the control should show or not partial items.
public abstract bool IntegralHeight { get; set; }
Gets a value indicating whether the drop down is shown.
public bool IsDropDownShown { get; }
Gets a value indicating whether the combo box is displaying its drop-down portion.
[Browsable(false)]
public bool IsDroppedDown { get; }
Gets whether the text input control of the combo box is in editable mode.
public bool IsWritable { get; }
Gets a collection representing the items contained in this ComboBox.
public abstract RadItemCollection Items { get; }
LimitToList Property
public bool LimitToList { get; set; }
Gets or sets the maximum number of items to be shown in the drop-down portion of the ComboBox.
public int MaxDropDownItems { get; set; }
Gets or sets the maximum number of characters the user can type or paste into the text box control.
public int MaxLength { get; set; }
Gets or sets the text that is displayed when the ComboBox contains a null reference.
public string NullText { get; set; }
Gets or sets a boolean value determining whether the user can scroll through the items when the popup is closed by using the mouse wheel.
public bool ScrollOnMouseWheel { get; set; }
Gets or sets the index specifying the currently selected item.
[Browsable(true)]
public abstract int SelectedIndex { get; set; }
Gets or sets the currently selected item.
[Browsable(false)]
[Bindable(true)]
public abstract object SelectedItem { get; set; }
Gets or sets the text that is selected in the editable portion of the ComboBox.
[Browsable(false)]
public string SelectedText { get; set; }
Gets or sets value specifying the currently selected item.
[Browsable(false)]
[Bindable(true)]
public abstract object SelectedValue { get; set; }
Gets or sets the number of characters selected in the editable portion of the combo box.
[Browsable(false)]
public int SelectionLength { get; set; }
Gets or sets the starting index of text selected in the combo box.
[Browsable(false)]
public int SelectionStart { get; set; }
Gets or sets a value indicating the sort style the of items in the combo box.
public SortStyle Sorted { get; set; }
Gets or sets the visual element used to display text when the combo box is not in editable drop-down mode. The default element is bound to the text editor and added to the layout during child creation. Changing this property after child creation updates the stored reference but does not replace the element already in the layout.
public LightVisualElement TextboxContentElement { get; set; }
Gets the TextBoxElement which is used in the ComboBox.
[Browsable(false)]
public RadTextBoxElement TextBoxElement { get; }
Gets or sets the combo-box value. In this base implementation, ValueMember delegates to SelectedValue; otherwise, setting a non-null value attempts an exact text match (leaving selection unchanged if none exists), setting null clears selection, and getting returns an empty string. Derived elements may provide a different value mapping.
public override object Value { get; set; }
Overrides:
Gets or sets t he property to use as the actual value for the items.
public abstract string ValueMember { get; set; }
Gets or sets a value indicating whether RadScrollViewer uses UI virtualization.
[Browsable(true)]
public abstract bool Virtualized { get; set; }
Identifies this element as a drop-down editor so editing hosts can place it in a popup.
public override EditorVisualMode VisualMode { get; }
Overrides:
Methods
Applies the owner element's theme to the popup and recalculates popup layout when the theme changes.
protected virtual void ApplyThemeToPopupForm()
Selects the current editor text when it is writable; it does not move focus.
public override void BeginEdit()
Overrides:
Call BeginUpdate at the begining of a block that makes many modifications in the GUI EndUpdate()
public abstract void BeginUpdate()
Creates the arrow button, text editor, display element, and layout panel, then wires the editor events.
protected override void CreateChildElements()
Overrides:
Unwires editor event handlers and stops the delayed autocomplete filter timer before base cleanup.
protected override void DisposeManagedResources()
Overrides:
Scrolls the open popup downward by one small scroll increment.
protected abstract void DoScrollLineDown()
Scrolls the open popup upward by one small scroll increment.
protected abstract void DoScrollLineUp()
Call BeginUpdate at the end of a block that makes many modifications in the GUI BeginUpdate()
public abstract void EndUpdate()
Finds items whose displayed text begins with the specified prefix. Multi-column combo boxes use the hosted grid's case-sensitivity setting.
Finds the index of the item with the specified text. The passed argument is compared with the DisplayMember value for each item in the items collection.
Forwards editor mouse-wheel input and toggles the popup when the arrow or a drop-down-list editor is clicked.
protected override void OnBubbleEvent(RadElement sender, RoutedEventArgs args)
The element that raised the routed event.
argsRoutedEventArgsThe routed event data.
Overrides:
Raises the CaseSensitiveChanged event.
When DblClickRotate is enabled, advances selection to the next item, wraps at the end, and closes the popup.
protected override void OnDoubleClick(EventArgs e)
The double-click event data.
Overrides:
Raises the DropDownStyleChanged event.
Uses the wheel to change the selected item when the popup is closed and ScrollOnMouseWheel is enabled, or to scroll the popup when it is open.
protected override void OnMouseWheel(MouseEventArgs e)
The wheel direction and movement delta.
Overrides:
Clears IntegralHeight when DropDownHeight changes.
protected override void OnNotifyPropertyChanged(string propertyName)
The name of the property that changed.
Overrides:
Clears IsDropDownShown before notifying the base popup-closed handler.
protected override void OnPopupClosed(RadPopupClosedEventArgs e)
The close reason and other popup-close data.
Overrides:
Sets IsDropDownShown before notifying the base popup-opened handler.
protected override void OnPopupOpened(EventArgs args)
The popup-opened event data.
Overrides:
Synchronizes editor read-only state, child drop-down styles, change notifications, and popup animation after property updates.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property change and its old and new values.
Overrides:
Rejects enabling sorting while the combo box is data-bound.
protected override void OnPropertyChanging(RadPropertyChangingEventArgs args)
The property change being evaluated.
Exceptions: InvalidOperationExceptionSorting is enabled while DataSource is set.
Overrides:
Raises the SelectedIndexChanged event.
Raises the SelectedValueChanged event.
Raises the SortedChanged event.
Updates the popup's image list when the root element reports an image-list change.
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
The element that raised the routed event.
argsRoutedEventArgsThe routed event data.
Overrides:
In drop-down-list mode, selects the first item when one exists and marks Delete or Backspace as handled.
protected virtual void ProcessDeleteKey(KeyEventArgs e)
The Delete or Backspace key event.
Processes the Escape key
public virtual bool ProcessEscKey(KeyEventArgs e)
An instance of KeyEventArgs
Returns:true if the event is processed, false otherwise
Handles combo-box keyboard navigation and popup shortcuts, delegating page navigation and key-specific behavior to overridable hooks.
protected virtual void ProcessKeyDown(object sender, KeyEventArgs e)
The editor element that raised the key event.
eKeyEventArgsThe key and modifier state; recognized navigation keys may be marked handled.
Provides an extension hook for handling Page Up and Page Down; the base implementation does not change selection.
protected virtual void ProcessPageUpDownKeys(KeyEventArgs e)
The Page Up or Page Down key event.
Processes the Enter key
public virtual void ProcessReturnKey(KeyEventArgs e)
An instance of KeyEventArgs
Captures changed editor text in LastTypedText for autocomplete tracking, except in list-only, design, or index-changing states.
Starts autocomplete filtering after text input is released, using AutoFilterDelay to defer filtering when configured. Enter, arrow, and Escape keys, and the non-editable drop-down-list style, skip this filter path.
protected virtual void ProcessTextKeyUp(object sender, KeyEventArgs e)
The editor element that raised the key event.
eKeyEventArgsThe released key and modifier state.
Ensures that the specified item is visible in the popup.
protected abstract void ScrollItemIntoView(object item)
The item to bring into view.
Moves the popup's viewport to its first item.
protected abstract void ScrollToHome()
Selects all the text in the editable portion of the combo box.
public void SelectAll()
Selects the editor text from its beginning through the length of text when the editor is editable.
The method does not replace the editor contents.
Provides a hook for selecting the following item during keyboard or mouse-wheel navigation.
protected virtual void SelectNextItem()
Provides a hook for selecting the preceding item during keyboard or mouse-wheel navigation.
protected virtual void SelectPreviousItem()
Synchronizes the active selection with an item instance; concrete elements may not support this overload.
Synchronizes the active selection with the item whose text matches the specified value.
Applies append-style autocomplete for a key press; implementations can complete from a matching item and enforce list-only input.
protected abstract void SetAppendAutoComplete(KeyPressEventArgs e)
The key press, which an implementation may mark handled when input is rejected or completed.
Selects an exact match while the popup is open, or opens the popup when a non-control character is typed while it is closed.
protected virtual void SetSuggestAutoComplete()
Applies popup theme and sizing before opening, brings the selected item into view, and synchronizes the active item after opening.
public override void ShowPopup()
Overrides:
Provides a hook to inspect an editor text change before it is applied; the base implementation does nothing.
protected virtual void TextBox_TextChanging(object sender, TextChangingEventArgs e)
The text element raising the change notification.
eTextChangingEventArgsThe proposed text change and its previous value.
Removes the event handlers attached by WireEvents().
protected virtual void UnwireEvents()
Attaches keyboard, text, focus, mouse-wheel, and pointer-entry handlers to the editor elements and hosted text box.
protected virtual void WireEvents()
Events
Occurs when the CaseSensitive property has changed.
[Browsable(true)]
public event EventHandler CaseSensitiveChanged
Occurs after the DropDownStyle property changes.
[Browsable(true)]
public event EventHandler DropDownStyleChanged
Occurs when the SelectedIndex property has changed.
[Browsable(true)]
public event EventHandler SelectedIndexChanged
Fires when the selected value is changed.
[Browsable(true)]
public event EventHandler SelectedValueChanged
Occurs when the Sorted property has changed.
[Browsable(true)]
public event EventHandler SortedChanged