skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class SelectionHelper

Represents a helper class which is used for selection.

Inheritance
System.Object
SelectionHelper
Namespace: Telerik.Windows.Controls.Primitives
Assembly: Telerik.Windows.Controls.dll

Syntax

public class SelectionHelper : Object

Constructors

SelectionHelper(Func<Boolean>, ISelectorInteraction, ISelectionBehavior, Action<Object, SelectionChangedEventArgs>)

Initializes a new instance of the SelectionHelper class.

Declaration
public SelectionHelper(Func<bool> canExecute, ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)
Parameters
System.Func<System.Boolean> canExecute

ISelectorInteraction selector

ISelectionBehavior behavior

System.Action<System.Object, System.Windows.Controls.SelectionChangedEventArgs> selectionCallBack

SelectionHelper(ISelectorInteraction, ISelectionBehavior, Action<Object, SelectionChangedEventArgs>)

Initializes a new instance of the SelectionHelper class.

Declaration
public SelectionHelper(ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)
Parameters
ISelectorInteraction selector

ISelectionBehavior behavior

System.Action<System.Object, System.Windows.Controls.SelectionChangedEventArgs> selectionCallBack

Properties

IsActive

Gets a value indicating whether the selection is active.

Declaration
public bool IsActive { get; }
Property Value
System.Boolean

SelectedIndex

Gets the index of the selected item.

Declaration
public int SelectedIndex { get; }
Property Value
System.Int32

SelectedItem

Gets the selected item.

Declaration
public object SelectedItem { get; }
Property Value
System.Object

Methods

AddToSelection(IEnumerable)

Adds items to selection.

Declaration
public void AddToSelection(IEnumerable items)
Parameters
System.Collections.IEnumerable items

ClearSelection()

Clears the selection.

Declaration
public void ClearSelection()

DeselectItems(IEnumerable)

UnSelects the items.

Declaration
public void DeselectItems(IEnumerable items)
Parameters
System.Collections.IEnumerable items

GetSelectedItems()

Gets the selected items.

Declaration
public IList GetSelectedItems()
Returns
System.Collections.IList

ResumeExecution()

Tries to execute all enqueued selection actions.

Declaration
public bool ResumeExecution()
Returns
System.Boolean

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

SelectItems(IEnumerable)

Selects the items.

Declaration
public void SelectItems(IEnumerable items)
Parameters
System.Collections.IEnumerable items

UpdateSelection(UIElement, Boolean)

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

Declaration
public void UpdateSelection(UIElement container, bool isSelected)
Parameters
System.Windows.UIElement container

System.Boolean isSelected

UpdateSelectionBehavior(ISelectionBehavior)

Updates the selection behavior.

Declaration
public void UpdateSelectionBehavior(ISelectionBehavior behavior)
Parameters
ISelectionBehavior behavior

UpdateSelectionOnUserInteraction(Object, SelectionMouseState)

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

Declaration
public void UpdateSelectionOnUserInteraction(object item, SelectionMouseState mouseState)
Parameters
System.Object item

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

SelectionMouseState mouseState

Indicates which mouse button was used to perform the operations.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.