Class ListBox
Represents a ListBox control.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public class ListBox : Selector
Constructors
ListBox()
Fields
SelectedItemsProperty
Identifies the SelectedItems dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
System.Windows.DependencyProperty
|
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
System.Windows.DependencyProperty
|
Properties
AnchorItem
The current anchor item.
Declaration
protected object AnchorItem { get; set; }
Property Value
System.Object
|
FocusedIndex
Gets the index of the focused ListBox item.
Declaration
protected int FocusedIndex { get; }
Property Value
System.Int32
|
FocusedItem
Gets the focused item.
Declaration
public ListBoxItem FocusedItem { get; }
Property Value
ListBoxItem
The focused item. |
SelectedItems
Gets or sets the selected items.
Declaration
public IList SelectedItems { get; }
Property Value
System.Collections.IList
The selected items. |
SelectionMode
Gets or sets the selection mode.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
SelectionMode
The selection mode. |
Methods
ElementScrollViewerScrollInDirection(Key)
Scrolls the ScrollViewer element in the specified direction, if present in the control template.
Declaration
protected void ElementScrollViewerScrollInDirection(Key key)
Parameters
System.Windows.Input.Key
key
|
GetContainerForItemOverride()
Creates or identifies the element used to display a specified item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
System.Windows.DependencyObject
A System.Windows.Controls.ListBoxItem. |
HandleKeyDown(Key, ListBoxItem)
Handles the keyboard input.
Declaration
protected virtual bool HandleKeyDown(Key key, ListBoxItem originalSource)
Parameters
System.Windows.Input.Key
key
|
ListBoxItem
originalSource
|
Returns
System.Boolean
|
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is (or is eligible to be) its own container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
System.Object
item
The item to check. |
Returns
System.Boolean
True if the item is (or is eligible to be) its own container; otherwise, false. |
IsVerticalOrientation()
Gets the value specifying whether the control is vertical, or not.
Declaration
protected bool IsVerticalOrientation()
Returns
System.Boolean
|
MakeAnchorSelection(ListBoxItem)
Selects the items between the current anchor item and the specified item.
Declaration
protected void MakeAnchorSelection(ListBoxItem actionItem)
Parameters
ListBoxItem
actionItem
The item that has been clicked. |
MakeAnchorSelection(ListBoxItem, Boolean)
Selects the items between the current anchor item and the specified item.
Declaration
protected void MakeAnchorSelection(ListBoxItem actionItem, bool clearCurrent)
Parameters
ListBoxItem
actionItem
The item that has been clicked. |
System.Boolean
clearCurrent
Boolean specifying whether to clear the current selection or not. |
MakeSingleSelection(ListBoxItem)
Selects the specified item, unselects any other selected items.
Declaration
protected void MakeSingleSelection(ListBoxItem listItem)
Parameters
ListBoxItem
listItem
The item to select. |
MakeToggleSelection(ListBoxItem)
Toggles the selected state of the specified item. Updates the anchor item.
Declaration
protected void MakeToggleSelection(ListBoxItem item)
Parameters
ListBoxItem
item
The item. |
NavigateNext()
NavigatePrev()
NavigateToItem(Object)
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
Overrides
OnKeyDown(Object, KeyEventArgs)
Called when OnKeyDown event is raised.
Declaration
protected virtual void OnKeyDown(object sender, KeyEventArgs e)
Parameters
System.Object
sender
The sender. |
System.Windows.Input.KeyEventArgs
e
The System.Windows.Input.KeyEventArgs instance containing the event data. |
OnSelectionChanged(SelectionChangedEventArgs)
Called when the selection changes.
Declaration
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
System.Windows.Controls.SelectionChangedEventArgs
e
The event data. |
Overrides
ScrollIntoView(Object)
Scrolls the control to the specified item.
Declaration
protected void ScrollIntoView(object item)
Parameters
System.Object
item
|
Select(Object)
Selects the specified item.
Declaration
protected void Select(object item)
Parameters
System.Object
item
The item. |
SelectAll()
Selects all.
Declaration
public void SelectAll()
Exceptions
System.NotSupportedException
|
SetFocusedItem(Int32, Boolean)
Focuses the item at the specified index, optionally scrolling the control to make it visible.
Declaration
protected void SetFocusedItem(int index, bool scrollIntoView)
Parameters
System.Int32
index
|
System.Boolean
scrollIntoView
|