Class
ListControl

Represents the list control that has multi-selection.

Definition

Namespace:Telerik.Windows.Controls.Primitives

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class ListControl : ItemsControlSelector, IMultiSelector, ISelector, ISelectorInteraction, IAutocomplete, IListControl, ICommandSource, IScrollingServiceCore, IScrollingInfo

Inheritance: objectItemsControlSelectorListControl

Derived Classes: RadListBox

Implements: IAutocompleteICommandSourceIListControlIMultiSelectorIScrollingInfoIScrollingServiceCoreISelectorISelectorInteraction

Inherited Members ItemsControlSelector.SelectionModePropertyItemsControlSelector.IsSynchronizedWithCurrentItemPropertyItemsControlSelector.SelectedIndexPropertyItemsControlSelector.SelectedItemPropertyItemsControlSelector.SelectedValuePropertyItemsControlSelector.SelectedValuePathPropertyItemsControlSelector.TextPropertyItemsControlSelector.TextPathPropertyItemsControlSelector.EnableSelectionCachingPropertyItemsControlSelector.SelectionChangedEventItemsControlSelector.IsItemSelectable(object)ItemsControlSelector.GetDataItem(UIElement)ItemsControlSelector.OnItemsSourceChanged(IEnumerable, IEnumerable)ItemsControlSelector.OnItemsChanged(NotifyCollectionChangedEventArgs)ItemsControlSelector.ChangeVisualState(bool)ItemsControlSelector.OnIsEnabledChanged(DependencyPropertyChangedEventArgs)ItemsControlSelector.InitializeValueRetriever()ItemsControlSelector.InitializeTextRetriever()ItemsControlSelector.UpdateItems(NotifyCollectionChangedAction, IList, IList)ItemsControlSelector.InitializeSelectionBehavior()ItemsControlSelector.GetSelectionBehavior()ItemsControlSelector.EndInit()ItemsControlSelector.SelectionModeItemsControlSelector.IsSynchronizedWithCurrentItemItemsControlSelector.SelectedItemsItemsControlSelector.SelectionHelperItemsControlSelector.SelectedIndexItemsControlSelector.SelectedItemItemsControlSelector.SelectedValueItemsControlSelector.SelectedValuePathItemsControlSelector.SelectedValueBindingItemsControlSelector.TextBindingItemsControlSelector.TextItemsControlSelector.TextPathItemsControlSelector.EnableSelectionCachingItemsControlSelector.ItemSearchItemsControlSelector.ValueRetrieverItemsControlSelector.TextRetrieverItemsControlSelector.SelectionChanged

Constructors

ListControl()

Initializes a new instance of the ListControl class.

Declaration

cs-api-definition
public ListControl()

Fields

CanAutocompleteSelectItemsProperty

Identifies the CanAutocompleteSelectItems dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanAutocompleteSelectItemsProperty

Field Value

DependencyProperty

CanAutocompleteSelectPartialMatchesProperty

Identifies the CanAutocompleteSelectPartialMatches dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanAutocompleteSelectPartialMatchesProperty

Field Value

DependencyProperty

CanKeyboardNavigationSelectItemsProperty

Identifies the CanListControlKeyboardNavigationSelectItems dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanKeyboardNavigationSelectItemsProperty

Field Value

DependencyProperty

CommandParameterProperty

Identifies the CommandParameter dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandParameterProperty

Field Value

DependencyProperty

CommandProperty

Identifies the Command dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandProperty

Field Value

DependencyProperty

CommandTargetProperty

Identifies the CommandTarget dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CommandTargetProperty

Field Value

DependencyProperty

IsScrollIntoViewEnabledProperty

Identifies the IsScrollIntoViewOnSelectionEnabled dependency property. This property determines of the selected item will be automatically scrolled into the view.

Declaration

cs-api-definition
public static readonly DependencyProperty IsScrollIntoViewEnabledProperty

Field Value

DependencyProperty

TextSearchModeProperty

Identifies the TextSearchMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TextSearchModeProperty

Field Value

DependencyProperty

TypedTextProperty

Identifies the TypedText dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TypedTextProperty

Field Value

DependencyProperty

Properties

AutocompleteBehavior

Gets or sets the autocomplete behavior.

Declaration

cs-api-definition
protected AutocompleteBehavior AutocompleteBehavior { get; set; }

Property Value

AutocompleteBehavior

CanAutocompleteSelectItems

Gets or sets a value that specifies whether the autocomplete should select items, or not. This is a dependency property.

Declaration

cs-api-definition
public bool? CanAutocompleteSelectItems { get; set; }

Property Value

bool?

CanAutocompleteSelectPartialMatches

Gets or sets a value that specifies whether the autocomplete should select partially matching items, or not. This is a dependency property.

Declaration

cs-api-definition
public bool CanAutocompleteSelectPartialMatches { get; set; }

Property Value

bool

CanKeyboardNavigationSelectItems

Gets or sets the CanKeyboardNavigationSelectItems. This is a dependency property.

Declaration

cs-api-definition
public bool? CanKeyboardNavigationSelectItems { get; set; }

Property Value

bool?

Command

Gets or sets the Command. This is a dependency property.

Declaration

cs-api-definition
[TypeConverter(typeof(CommandConverter))]
public ICommand Command { get; set; }

Property Value

ICommand

CommandParameter

Gets or sets the CommandParameter. This is a dependency property.

Declaration

cs-api-definition
public object CommandParameter { get; set; }

Property Value

object

CommandTarget

Gets or sets the CommandTarget. This is a dependency property.

Declaration

cs-api-definition
public IInputElement CommandTarget { get; set; }

Property Value

IInputElement

HighlightedIndex

Gets the index of the highlighted item.

Declaration

cs-api-definition
public int HighlightedIndex { get; }

Property Value

int

The index of the highlighted.

Implements IListControl.HighlightedIndex

HighlightedItem

Gets or sets the highlighted item.

Declaration

cs-api-definition
protected object HighlightedItem { get; set; }

Property Value

object

IsItemsHostVisible

Gets a value indicating whether the items host is visible. Override if a custom logic is required. Default value is true.

Declaration

cs-api-definition
protected virtual bool IsItemsHostVisible { get; }

Property Value

bool

IsScrollIntoViewEnabled

Gets or sets the IsScrollIntoViewEnabled. This is a dependency property.

Declaration

cs-api-definition
public bool IsScrollIntoViewEnabled { get; set; }

Property Value

bool

KeyboardNavigation

Gets the keyboard navigation.

Declaration

cs-api-definition
protected KeyboardNavigation KeyboardNavigation { get; }

Property Value

KeyboardNavigation

SelectAllCommand

Gets the command that will be executed when select all. This is a RoutedUICommand.

Declaration

cs-api-definition
public static RoutedUICommand SelectAllCommand { get; }

Property Value

RoutedUICommand

TextSearchMode

Gets or sets the text search mode. Specifies how TextSearch will match items. This is a dependency property.

Declaration

cs-api-definition
public TextSearchMode TextSearchMode { get; set; }

Property Value

TextSearchMode

The text search mode.

TypedText

Gets or sets the current typed text. This is a dependency property.

Declaration

cs-api-definition
public string TypedText { get; set; }

Property Value

string

Methods

CanPerformSelection()

Indicates whether the selection helper can perform operation or not.

Declaration

cs-api-definition
protected override bool CanPerformSelection()

Returns

bool

Returns true if the panel is not null, is not Grid and ItemContainerGenerator.Status is GeneratingContainers; otherwise false.

Overrides ItemsControlSelector.CanPerformSelection()

ClearContainerForItemOverride(DependencyObject, object)

Clears the values for SelectionHelper, ParentSelector and IsSelected properties.

Declaration

cs-api-definition
protected override void ClearContainerForItemOverride(DependencyObject element, object item)

Parameters

element

DependencyObject

The ListItem container element.

item

object

The item.

ClearContainerStates(FrameworkElement)

Clears the properties that effect the visual states for the given container. This method is called in ClearContainerForItemOverride(DependencyObject, object)

Declaration

cs-api-definition
protected virtual void ClearContainerStates(FrameworkElement container)

Parameters

container

FrameworkElement

The container which is cleared for item override.

GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

Declaration

cs-api-definition
protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject

The element that is used to display the given item.

GetScrollViewerPart()

Called on initializing the ScrollViewer on template applied. It's mandatory to get the ScrollViewer in order to perform selection.

Declaration

cs-api-definition
protected virtual ScrollViewer GetScrollViewerPart()

Returns

ScrollViewer

The ScrollViewer instance in the control template.

Remarks

If there is no ScrollViewer in the control template, override the logic in CanPerformSelection() method.

HandleKeyboardInput(Key)

When overridden in a derived class, is invoked whenever application code or internal processes call HandleKeyboardInput(Key). Override this method if a custom keyboard navigation is required.

Declaration

cs-api-definition
protected virtual bool HandleKeyboardInput(Key key)

Parameters

key

Key

The key.

Returns

bool

HighlightedIndexChanged(int, Key)

Highlights the changed index.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected virtual void HighlightedIndexChanged(int index, Key key = 0)

Parameters

index

int

key

Key

IsIndexSelectable(int)

Determines whether the index is selectable.

Declaration

cs-api-definition
protected override bool IsIndexSelectable(int index)

Parameters

index

int

The index.

Returns

bool

Overrides ItemsControlSelector.IsIndexSelectable(int)

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own container.

Declaration

cs-api-definition
protected override bool IsItemItsOwnContainerOverride(object item)

Parameters

item

object

The item to check.

Returns

bool

True if the item is (or is eligible to be) its own container; otherwise, false.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call .

Declaration

cs-api-definition
public override void OnApplyTemplate()

Overrides ItemsControlSelector.OnApplyTemplate()

OnAutocompleteBehaviorTypedTextChanged()

Called when a text is typed.

Declaration

cs-api-definition
protected virtual void OnAutocompleteBehaviorTypedTextChanged()

OnItemsPanelChanged(ItemsPanelTemplate, ItemsPanelTemplate)

Invoked when the property changes.

Declaration

cs-api-definition
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)

Parameters

oldItemsPanel

ItemsPanelTemplate

Old value of the property.

newItemsPanel

ItemsPanelTemplate

New value of the property.

OnMatchingItemChanged()

When overridden in a derived class, is invoked whenever application code or internal processes call OnMatchingItemChanged(). Called when matching item is changed. Override this method if a custom logic is required when an item is changed.

Declaration

cs-api-definition
protected virtual void OnMatchingItemChanged()

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Declaration

cs-api-definition
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)

Parameters

e

DependencyPropertyChangedEventArgs

OnSelectionChanged(SelectionChangedEventArgs)

Called when the selection changes.

Declaration

cs-api-definition
protected override void OnSelectionChanged(SelectionChangedEventArgs e)

Parameters

e

SelectionChangedEventArgs

The event data.

Overrides ItemsControlSelector.OnSelectionChanged(SelectionChangedEventArgs)

OnSelectionModeChanged()

Called when selection mode changed. Update CanAutocompleteSelectItems property.

Declaration

cs-api-definition
protected override void OnSelectionModeChanged()

Overrides ItemsControlSelector.OnSelectionModeChanged()

PrepareContainerForItemOverride(DependencyObject, object)

Prepares the specified element to display the specified item.

Declaration

cs-api-definition
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)

Parameters

element

DependencyObject

Element used to display the specified item.

item

object

Specified item.

ScrollIntoView(int)

Scrolls the into view.

Declaration

cs-api-definition
public void ScrollIntoView(int index)

Parameters

index

int

The index.

Implements IListControl.ScrollIntoView(int)

ScrollIntoView(object)

Scrolls the into view.

Declaration

cs-api-definition
public void ScrollIntoView(object item)

Parameters

item

object