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

Represents a helper class which is used for selection.

Definition

Namespace:Telerik.Windows.Controls.Primitives

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class SelectionHelper

Inheritance: objectSelectionHelper

Constructors

Initializes a new instance of the SelectionHelper class.

C#
[Obsolete("Obsoleted in Q2 2014. Not used and it will be deleted in future versions.")]
public SelectionHelper(Func<bool> canExecute, ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)
Parameters:canExecuteFunc<bool>selectorISelectorInteractionbehaviorISelectionBehaviorselectionCallBackAction<object, SelectionChangedEventArgs>

Initializes a new instance of the SelectionHelper class.

C#
public SelectionHelper(ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)
Parameters:selectorISelectorInteractionbehaviorISelectionBehaviorselectionCallBackAction<object, SelectionChangedEventArgs>

Properties

Gets a value indicating whether the selection is active.

C#
public bool IsActive { get; }

Gets the index of the selected item.

C#
public int SelectedIndex { get; }

Gets the selected item.

C#
public object SelectedItem { get; }

Methods

Adds items to selection.

C#
public void AddToSelection(IEnumerable items)
Parameters:itemsIEnumerable

Clears the selection.

C#
public void ClearSelection()

UnSelects the items.

C#
public void DeselectItems(IEnumerable items)
Parameters:itemsIEnumerable

Gets the selected items.

C#
public IList GetSelectedItems()
Returns:

IList

Tries to execute all enqueued selection actions.

C#
[Obsolete("Obsoleted in Q2 2014. Not used and it will be deleted in future versions.")]
public bool ResumeExecution()
Returns:

bool

Returns true if the actions can be executed, otherwise returns false.

Selects the items.

C#
public void SelectItems(IEnumerable items)
Parameters:itemsIEnumerable

Updates the selection using the container and the current selected state.

C#
public void UpdateSelection(UIElement container, bool isSelected)
Parameters:containerUIElementisSelectedbool

Updates the selection behavior.

C#
public void UpdateSelectionBehavior(ISelectionBehavior behavior)
Parameters:behaviorISelectionBehavior

Updates the selection on user interaction. The second SelectionMouseState parameter is optional. By default is SelectionMouseState.Left.

C#
public void UpdateSelectionOnUserInteraction(object item, SelectionMouseState mouseState = SelectionMouseState.Left)
Parameters:itemobject

The data item or the container that was affected by the UI selection operation.

mouseStateSelectionMouseState

Indicates which mouse button was used to perform the operations.