New to Telerik UI for WPFStart a free 30-day trial

Represents the list control that has multi-selection.

Definition

Namespace:Telerik.Windows.Controls.Primitives

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
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

Initializes a new instance of the ListControl class.

C#
public ListControl()

Fields

Identifies the CanAutocompleteSelectItems dependency property.

C#
public static readonly DependencyProperty CanAutocompleteSelectItemsProperty

Identifies the CanAutocompleteSelectPartialMatches dependency property.

C#
public static readonly DependencyProperty CanAutocompleteSelectPartialMatchesProperty

Identifies the CanListControlKeyboardNavigationSelectItems dependency property.

C#
public static readonly DependencyProperty CanKeyboardNavigationSelectItemsProperty

CommandParameterProperty

DependencyProperty

Identifies the CommandParameter dependency property.

C#
public static readonly DependencyProperty CommandParameterProperty

CommandProperty

DependencyProperty

Identifies the Command dependency property.

C#
public static readonly DependencyProperty CommandProperty

CommandTargetProperty

DependencyProperty

Identifies the CommandTarget dependency property.

C#
public static readonly DependencyProperty CommandTargetProperty

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

C#
public static readonly DependencyProperty IsScrollIntoViewEnabledProperty

TextSearchModeProperty

DependencyProperty

Identifies the TextSearchMode dependency property.

C#
public static readonly DependencyProperty TextSearchModeProperty

TypedTextProperty

DependencyProperty

Identifies the TypedText dependency property.

C#
public static readonly DependencyProperty TypedTextProperty

Properties

Gets or sets the autocomplete behavior.

C#
protected AutocompleteBehavior AutocompleteBehavior { get; set; }

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

C#
public bool? CanAutocompleteSelectItems { get; set; }

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

C#
public bool CanAutocompleteSelectPartialMatches { get; set; }

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

C#
public bool? CanKeyboardNavigationSelectItems { get; set; }

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

C#
[TypeConverter(typeof(CommandConverter))]
public ICommand Command { get; set; }

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

C#
public object CommandParameter { get; set; }

CommandTarget

IInputElement

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

C#
public IInputElement CommandTarget { get; set; }

Gets the index of the highlighted item.

C#
public int HighlightedIndex { get; }
Property Value:

The index of the highlighted.

Implements: IListControl.HighlightedIndex

Gets or sets the highlighted item.

C#
protected object HighlightedItem { get; set; }

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

C#
protected virtual bool IsItemsHostVisible { get; }

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

C#
public bool IsScrollIntoViewEnabled { get; set; }

Gets the keyboard navigation.

C#
protected KeyboardNavigation KeyboardNavigation { get; }

SelectAllCommand

RoutedUICommand

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

C#
public static RoutedUICommand SelectAllCommand { get; }

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

C#
public TextSearchMode TextSearchMode { get; set; }
Property Value:

The text search mode.

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

C#
public string TypedText { get; set; }

Methods

Indicates whether the selection helper can perform operation or not.

C#
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()

Clears the values for SelectionHelper, ParentSelector and IsSelected properties.

C#
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

The ListItem container element.

itemobject

The item.

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

C#
protected virtual void ClearContainerStates(FrameworkElement container)
Parameters:containerFrameworkElement

The container which is cleared for item override.

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

C#
protected override DependencyObject GetContainerForItemOverride()
Returns:

DependencyObject

The element that is used to display the given item.

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

C#
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.

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.

C#
protected virtual bool HandleKeyboardInput(Key key)
Parameters:keyKey

The key.

Returns:

bool

Highlights the changed index.

C#
protected virtual void HighlightedIndexChanged(int index, Key key = 0)
Parameters:indexintkeyKey

Determines whether the index is selectable.

C#
protected override bool IsIndexSelectable(int index)
Parameters:indexint

The index.

Returns:

bool

Overrides: ItemsControlSelector.IsIndexSelectable(int)

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

C#
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters:itemobject

The item to check.

Returns:

bool

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

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

C#
public override void OnApplyTemplate()

Overrides: ItemsControlSelector.OnApplyTemplate()

Called when a text is typed.

C#
protected virtual void OnAutocompleteBehaviorTypedTextChanged()

Invoked when the property changes.

C#
protected override void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
Parameters:oldItemsPanelItemsPanelTemplate

Old value of the property.

newItemsPanelItemsPanelTemplate

New value of the property.

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.

C#
protected virtual void OnMatchingItemChanged()
C#
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs

Called when the selection changes.

C#
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters:eSelectionChangedEventArgs

The event data.

Overrides: ItemsControlSelector.OnSelectionChanged(SelectionChangedEventArgs)

Called when selection mode changed. Update CanAutocompleteSelectItems property.

C#
protected override void OnSelectionModeChanged()

Overrides: ItemsControlSelector.OnSelectionModeChanged()

Prepares the specified element to display the specified item.

C#
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

Element used to display the specified item.

itemobject

Specified item.

Scrolls the into view.

C#
public void ScrollIntoView(int index)
Parameters:indexint

The index.

Implements: IListControl.ScrollIntoView(int)

Scrolls the into view.

C#
public void ScrollIntoView(object item)
Parameters:itemobject