ClassRadDropDownListElement
Represents the main element of a RadDropDownList control that provides drop-down functionality.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[RadToolboxItem(true)]
public class RadDropDownListElement : PopupEditorElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IInputEditor, IValueEditor, ISupportInitialize
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadEditorElementEditorBaseElementPopupEditorBaseElementPopupEditorElementRadDropDownListElement
Derived Classes:
Implements:
Inherited Members
Constructors
RadDropDownListElement()
Initializes a new instance of the RadDropDownListElement class.
Declaration
public RadDropDownListElement()
Fields
IsDropDownShownProperty
Identifies the IsDropDownShown dependency property.
Declaration
public static RadProperty IsDropDownShownProperty
Field Value
Properties
ArrowButton
ArrowButton Property
Declaration
public virtual RadArrowButtonElement ArrowButton { get; set; }
Property Value
ArrowButtonMinWidth
Get or sets the minimum width of the arrow button element.
Declaration
public virtual int ArrowButtonMinWidth { get; set; }
Property Value
AutoCompleteAppend
AutoCompleteAppend Property
Declaration
public virtual AutoCompleteAppendHelper AutoCompleteAppend { get; set; }
Property Value
AutoCompleteHelpers
Represent list of all AutoComplete Helpers
Declaration
public virtual List<BaseAutoComplete> AutoCompleteHelpers { get; }
Property Value
List<BaseAutoComplete>
AutoCompleteMode
Gets or sets the mode for the automatic text completion feature used in the RadDropDownListElement. Controls whether text is automatically completed while typing, displayed in a suggestion list, or both.
Declaration
[Browsable(true)]
public virtual AutoCompleteMode AutoCompleteMode { get; set; }
Property Value
AutoCompleteSuggest
AutoCompleteSuggest Property
Declaration
public virtual AutoCompleteSuggestHelper AutoCompleteSuggest { get; set; }
Property Value
AutoSizeItems
Gets or sets a value that indicates whether items will be sized according to their content. If this property is true the user can set the Height property of each individual RadListDataItem in the Items collection in order to override the automatic sizing.
Declaration
[Browsable(true)]
public virtual bool AutoSizeItems { get; set; }
Property Value
BindingContext
Gets or sets the BindingContext for this object, which provides the foundation for data binding operations and can be inherited from parent objects.
Declaration
public override BindingContext BindingContext { get; set; }
Property Value
Overrides
CaseSensitive
Gets or sets a value indicating whether string comparisons are case-sensitive. When enabled, searching and filtering operations in the dropdown will match exact letter case.
Declaration
[Browsable(true)]
public bool CaseSensitive { get; set; }
Property Value
DataMember
Gets or sets the name of the list or table in the data source for which the RadDropDownListElement is displaying data.
DataSource
Gets or sets the object that is responsible for providing data objects for the RadListElement.
DisplayMember
Gets or sets a string which will be used to get a text string for each visual item. This value can not be set to null. Setting it to null will cause it to contain an empty string.
Declaration
public virtual string DisplayMember { get; set; }
Property Value
DropDownAnimationEasing
Gets or sets the type of the DropDown animation.
Declaration
[Browsable(true)]
public virtual RadEasingType DropDownAnimationEasing { get; set; }
Property Value
DropDownAnimationEnabled
Gets or sets a value indicating whether the RadDropDownList will be animated when displaying.
Declaration
public virtual bool DropDownAnimationEnabled { get; set; }
Property Value
DropDownAnimationFrames
Gets or sets the number of frames that will be used when the DropDown is being animated.
Declaration
[Browsable(true)]
public virtual int DropDownAnimationFrames { get; set; }
Property Value
DropDownSizingMode
Declaration
[Browsable(true)]
public virtual SizingMode DropDownSizingMode { get; set; }
Property Value
DropDownStyle
Gets or sets the style of the dropdown list control. This determines whether the control allows direct text input or only selection from a predefined list.
Declaration
[Browsable(true)]
public virtual RadDropDownStyle DropDownStyle { get; set; }
Property Value
DropDownWidth
Gets or sets the drop down minimum width.
Declaration
[Browsable(true)]
public virtual int DropDownWidth { get; set; }
Property Value
EditableElement
EditableElement Property
Declaration
[Browsable(false)]
public RadDropDownListEditableAreaElement EditableElement { get; set; }
Property Value
EditableElementText
Get or set the text in Editable area
Declaration
public virtual string EditableElementText { get; set; }
Property Value
EnableMouseWheel
Enable or disable Mouse Wheel Scrolling.
Filter
Gets or sets a Predicate that will be called for every data item in order to determine if the item will be visible.
Declaration
public Predicate<RadListDataItem> Filter { get; set; }
Property Value
FilterExpression
Gets or sets a filter expression that determines which items will be visible.
FormatInfo
Gets the format provider used for formatting values in the dropdown list. This property provides advanced formatting capabilities for display values.
Declaration
[Browsable(false)]
public virtual IFormatProvider FormatInfo { get; set; }
Property Value
FormatString
Gets or sets a format string that will be used for visual item formatting if FormattingEnabled is set to true.
Declaration
public virtual string FormatString { get; set; }
Property Value
FormattingEnabled
Gets or sets a value that determines whether text formatting is enabled for the visual items.
Declaration
public virtual bool FormattingEnabled { get; set; }
Property Value
IsFilterActive
Gets a value indicating whether there is a Filter or FilterExpression set.
Declaration
[Browsable(false)]
public bool IsFilterActive { get; }
Property Value
IsPopupVisible
Gets a value that indicates if the popup associated with this RadDropDownListElement is open.
ItemHeight
Gets or sets the item height for the items.
Items
Declaration
public RadListDataItemCollection Items { get; }
Property Value
MaxLength
Gets or sets the maximum number of characters the user can type or paste into the text box control.
NullText
Gets or sets the text that is displayed when RadDropDownList has no text set.
NullTextColor
Gets or sets the color of prompt text that is displayed when the TextBox contains no text
RightToLeft
Gets or sets the direction of flow of the elements and whether elements are aligned to support locales using right-to-left fonts.
Declaration
public override bool RightToLeft { get; set; }
Property Value
Overrides
SelectNextOnDoubleClick
Gets or sets a value indicating whether the control should automatically select the next item when the user double-clicks in the edit box area. This enables cycling through available options without opening the dropdown.
Declaration
[Browsable(true)]
public bool SelectNextOnDoubleClick { get; set; }
Property Value
SelectedIndex
Declaration
[Browsable(true)]
public virtual int SelectedIndex { get; set; }
Property Value
SelectedItem
Declaration
[Browsable(false)]
[Bindable(true)]
public virtual RadListDataItem SelectedItem { get; set; }
Property Value
SelectedText
Gets or sets the text that is selected in the editable portion of the DropDownList.
Declaration
[Browsable(false)]
public string SelectedText { get; set; }
Property Value
SelectedValue
Declaration
[Browsable(false)]
[Bindable(true)]
public virtual object SelectedValue { get; set; }
Property Value
SelectionLength
Gets or sets the number of characters selected in the editable portion of the combo box.
Declaration
[Browsable(false)]
public int SelectionLength { get; set; }
Property Value
SelectionMode
For information on this property please refer to the MSDN.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
SelectionStart
Gets or sets the starting index of text selected in the combo box.
Declaration
[Browsable(false)]
public int SelectionStart { get; set; }
Property Value
ShowImageInEditorArea
Gets or sets a value indicating whether the RadListDataItem image will be displayed in the editor element when DropDownStyle is set to DropDownList.
Declaration
public virtual bool ShowImageInEditorArea { get; set; }
Property Value
SortStyle
Gets or sets the sort style. It can be Ascending, Descending or None. Sorting is performed according to the property specified by DisplayMember.
Declaration
public virtual SortStyle SortStyle { get; set; }
Property Value
SuspendSelectionEvents
Gets or sets a value that determines whether to stop the selection events from firing. These are SelectedIndexChanged, SelectedIndexChanging and SelectedValueChanged.
Declaration
[Browsable(false)]
public bool SuspendSelectionEvents { get; set; }
Property Value
SyncSelectionWithText
Gets or sets a value indicating whether the SelectedIndex is synchronized with the text in the editable area.
Declaration
public virtual bool SyncSelectionWithText { get; set; }
Property Value
TextBox
TextBox Property
Declaration
public RadDropDownTextBoxElement TextBox { get; set; }
Property Value
ValueMember
Gets or sets the string through which the SelectedValue property will be determined. This property can not be set to null. Setting it to null will cause it to contain an empty string.
Methods
BeginUpdate()
Declaration
public virtual void BeginUpdate()
CanClosePopUp(RadPopupCloseReason, MouseButtons)
Declaration
protected virtual bool CanClosePopUp(RadPopupCloseReason reason, MouseButtons buttons)
Parameters
reason
buttons
Returns
ClosePopup(RadPopupCloseReason)
Closes the dropdown popup with the specified reason.
Declaration
public override void ClosePopup(RadPopupCloseReason reason)
Parameters
reason
The reason for closing the popup, which can affect the closing behavior.
Overrides
ClosePopupCore()
Declaration
protected virtual void ClosePopupCore()
CreateArrowButtonElement()
Declaration
protected virtual RadDropDownListArrowButtonElement CreateArrowButtonElement()
Returns
CreateAutoCompleteAppendHandler()
Creates the auto complete append handler.
Declaration
protected virtual AutoCompleteAppendHelper CreateAutoCompleteAppendHandler()
Returns
CreateAutoCompleteSuggestHelper()
Creates the auto complete suggest helper.
Declaration
protected virtual AutoCompleteSuggestHelper CreateAutoCompleteSuggestHelper()
Returns
CreateChildElements()
Creates the visual elements that make up the RadDropDownListElement. This method initializes the border, fill, layout container and child elements.
Declaration
protected override void CreateChildElements()
Overrides
CreateElementsContainer()
Declaration
protected virtual StackLayoutElement CreateElementsContainer()
Returns
CreatePopupForm()
Creates and initializes the popup form used for the dropdown list.
Declaration
protected override RadPopupControlBase CreatePopupForm()
Returns
A new RadPopupControlBase instance configured for the dropdown list.
Overrides
CreateTextEditorElement()
Declaration
protected virtual RadDropDownListEditableAreaElement CreateTextEditorElement()
Returns
DeferRefresh()
Defers the refresh.
DisposeManagedResources()
Releases the managed resources used by the RadDropDownListElement.
Declaration
protected override void DisposeManagedResources()
Overrides
EndUpdate()
Declaration
public virtual void EndUpdate()
EnterPressedOrLeaveControl()
Handles the action when the Enter key is pressed or when the control loses focus.
Declaration
protected virtual void EnterPressedOrLeaveControl()
FindString(string)
Searches for an item related to the specified string. The relation is described by the object assigned to FindStringComparer property. By default FindStringComparer uses the System.String.StartsWith() method. This method starts searching from the specified index. If the algorithm reaches the end of the Items collection it wraps to the beginning and continues until one before the provided index.
FindString(string, int)
Searches for an item related to the specified string. The relation is described by the object assigned to FindStringComparer property. By default FindStringComparer uses the System.String.StartsWith() method. This method starts searching from the specified index. If the algorithm reaches the end of the Items collection it wraps to the beginning and continues until one before the provided index.
FindStringExact(string)
Searches for an item in the same manner as FindString() but matches an item only if its text is exactly equal to the provided string.
FindStringExact(string, int)
Searches for an item in the same manner as FindString() but matches an item only if its text is exactly equal to the provided string.
Focus()
Attempts to set the keyboard focus to the element.
Declaration
public override bool Focus()
Returns
True if the keyboard focus is successfully set to the element; otherwise, false.
Overrides
HandleEnterCore()
Declaration
protected virtual void HandleEnterCore()
HandleOnKeyUpKeyDownPress(KeyEventArgs)
Declaration
protected virtual void HandleOnKeyUpKeyDownPress(KeyEventArgs keyEventArgs)
Parameters
keyEventArgs
MeasureOverride(SizeF)
Provides the custom measurement logic for the RadDropDownListElement.
NotifyOwner(PopupEditorNotificationData)
main update entry point
Declaration
public override void NotifyOwner(PopupEditorNotificationData notificationData)
Parameters
notificationData
contains notification context
Overrides
OnAutoCompeleteDataSourceChanged()
Called when the AutoComplete data source has changed.
Declaration
protected override void OnAutoCompeleteDataSourceChanged()
Overrides
OnBubbleEvent(RadElement, RoutedEventArgs)
Handles bubbled events from child elements in the visual tree.
Declaration
protected override void OnBubbleEvent(RadElement sender, RoutedEventArgs args)
Parameters
sender
The source element that originated the event.
args
The event data.
Overrides
OnDoubleClick(EventArgs)
Handles the double-click event to select the next item when configured.
OnItemsChanged()
Called when the items collection of the dropdown list has changed.
Declaration
protected virtual void OnItemsChanged()
OnItemsClear()
Declaration
protected virtual void OnItemsClear()
OnKeyDown(KeyEventArgs)
Declaration
public virtual void OnKeyDown(KeyEventArgs e)
Parameters
e
OnKeyPress(KeyPressEventArgs)
Declaration
public virtual void OnKeyPress(KeyPressEventArgs e)
Parameters
e
OnKeyPress(RadDropDownListEditableAreaElement, KeyPressEventArgs)
Declaration
protected void OnKeyPress(RadDropDownListEditableAreaElement sender, KeyPressEventArgs e)
Parameters
sender
RadDropDownListEditableAreaElement
e
OnListItemDataBinding(object, ListItemDataBindingEventArgs)
Declaration
protected virtual void OnListItemDataBinding(object sender, ListItemDataBindingEventArgs args)
Parameters
sender
args
OnListItemDataBound(object, ListItemDataBoundEventArgs)
Declaration
protected virtual void OnListItemDataBound(object sender, ListItemDataBoundEventArgs args)
Parameters
sender
args
OnLoaded()
Called when the element is loaded into the element tree.
Declaration
protected override void OnLoaded()
Overrides
OnMouseWheel(MouseEventArgs)
Handles the mouse wheel events to enable scrolling through items.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
A MouseEventArgs that contains the event data.
Overrides
OnMouseWheelCore(MouseEventArgs)
Declaration
protected virtual void OnMouseWheelCore(MouseEventArgs e)
Parameters
e
OnParentChanged(RadElement)
Occurs when the parent element of this element has changed.
Declaration
protected override void OnParentChanged(RadElement previousParent)
Parameters
previousParent
The previous parent element.
Overrides
OnPopupClosed(object, RadPopupClosedEventArgs)
Called when the popup is closed.
Declaration
protected override void OnPopupClosed(object sender, RadPopupClosedEventArgs args)
Parameters
sender
The source of the event.
args
A RadPopupClosedEventArgs that contains the event data.
Overrides
OnPopupOpened(object, EventArgs)
Called when the dropdown popup is opened.
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
A RadPropertyChangedEventArgs that contains the event data.
Overrides
OnSelectedIndexChanged(object, PositionChangedEventArgs)
Declaration
protected virtual void OnSelectedIndexChanged(object sender, PositionChangedEventArgs e)
Parameters
sender
e
OnSelectedIndexChanging(object, PositionChangingCancelEventArgs)
Declaration
protected bool OnSelectedIndexChanging(object sender, PositionChangingCancelEventArgs e)
Parameters
sender
e
Returns
OnSelectedValueChanged(object, ValueChangedEventArgs)
Declaration
protected virtual void OnSelectedValueChanged(object sender, ValueChangedEventArgs e)
Parameters
sender
e
OnSortStyleChanged(SortStyle)
Declaration
protected virtual void OnSortStyleChanged(SortStyle sortStyle)
Parameters
sortStyle
OnTextChanged(RadDropDownListEditableAreaElement, EventArgs)
Declaration
protected void OnTextChanged(RadDropDownListEditableAreaElement sender, EventArgs args)
Parameters
sender
RadDropDownListEditableAreaElement
args
OnVisualElementCreated(object, CreatingVisualListItemEventArgs)
Declaration
protected virtual void OnVisualElementCreated(object sender, CreatingVisualListItemEventArgs args)
Parameters
sender
args
OnVisualItemFormatting(RadListVisualItem)
Declaration
protected virtual void OnVisualItemFormatting(RadListVisualItem item)
Parameters
item
ProcessKeyDown(object, KeyEventArgs)
Declaration
protected virtual void ProcessKeyDown(object sender, KeyEventArgs e)
Parameters
sender
e
ProcessKeyUp(object, KeyEventArgs)
Declaration
protected virtual void ProcessKeyUp(object sender, KeyEventArgs e)
Parameters
sender
e
ScrollToItemFromText(string)
Declaration
protected virtual void ScrollToItemFromText(string text)
Parameters
text
SelectAll()
Selects all items if the SelectionMode allows it.
Declaration
public void SelectAll()
Exceptions
Selecting all items is not a valid operation in the current selection mode. SelectionMode = + this.selectionMode.ToString() + .
SelectAllText()
Selects all the text in the editable portion of the combo box.
Declaration
public void SelectAllText()
SelectItemFromText(string)
Selects an item in the dropdown list based on the specified text.
SelectText(int, int)
Selects a range of text in the editable portion of the combo box
ShowPopup()
Shows the dropdown popup, displaying the list of available items. Also synchronizes the popup properties and ensures text and item selection are in sync.
Declaration
public override void ShowPopup()
Overrides
SyncVisualProperties(RadListDataItem)
Declaration
protected virtual void SyncVisualProperties(RadListDataItem listItem)
Parameters
listItem
listElement_DataItemPropertyChanged(object, RadPropertyChangedEventArgs)
Called when a property of a data item in the list element has changed.
Declaration
protected override void listElement_DataItemPropertyChanged(object sender, RadPropertyChangedEventArgs e)
Parameters
sender
The source of the event.
e
A RadPropertyChangedEventArgs that contains the event data.
Overrides
Events
CreatingVisualItem
Declaration
public event CreatingVisualListItemEventHandler CreatingVisualItem
Event Value
ItemDataBinding
Declaration
public event ListItemDataBindingEventHandler ItemDataBinding
Event Value
ItemDataBound
Declaration
public event ListItemDataBoundEventHandler ItemDataBound
Event Value
KeyPress
Declaration
public event KeyPressEventHandler KeyPress
Event Value
SelectedIndexChanged
Declaration
public event PositionChangedEventHandler SelectedIndexChanged
Event Value
SelectedIndexChanging
Declaration
public event PositionChangingEventHandler SelectedIndexChanging
Event Value
SelectedValueChanged
Declaration
public event ValueChangedEventHandler SelectedValueChanged
Event Value
SortStyleChanged
Declaration
public event SortStyleChangedEventHandler SortStyleChanged
Event Value
VisualItemFormatting
Declaration
public event VisualListItemFormattingEventHandler VisualItemFormatting
Event Value