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 SelectionRangeCollection

Represents a collection of selection ranges in a document.

Inheritance
System.Object
SelectionRangeCollection
Namespace: Telerik.Windows.Documents.Selection
Assembly: Telerik.Windows.Controls.RichTextBox.dll

Syntax

public class SelectionRangeCollection : Object, ICollection<SelectionRange>, IEnumerable<SelectionRange>, IEnumerable
Remarks

This collection allows for the management and manipulation of multiple selection ranges within a document structure.

Constructors

SelectionRangeCollection()

Declaration
public SelectionRangeCollection()

Properties

Count

Gets the number of selection ranges in the collection.

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

First

Gets the first selection range in the collection.

Declaration
public SelectionRange First { get; }
Property Value
SelectionRange

IsReadOnly

Gets a value indicating whether the selection range collection is read-only.

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

Last

Gets the last selection range in the collection.

Declaration
public SelectionRange Last { get; }
Property Value
SelectionRange

Methods

Add(SelectionRange)

Adds a new selection range to the collection.

Declaration
public void Add(SelectionRange item)
Parameters
SelectionRange item

The selection range to be added to the collection.

Clear()

Removes all selections from the SelectionRangeCollection.

Declaration
public void Clear()
Remarks

This method clears the current collection of selected ranges, effectively resetting the selection.

Contains(SelectionRange)

Determines whether the specified selection range is contained within the collection.

Declaration
public bool Contains(SelectionRange item)
Parameters
SelectionRange item

The selection range to check for containment.

Returns
System.Boolean

True if the collection contains the specified selection range; otherwise, false.

CopyTo(SelectionRange[], Int32)

Copies the elements of the current SelectionRangeCollection to a specified array, starting at a particular array index.

Declaration
public void CopyTo(SelectionRange[] array, int arrayIndex)
Parameters
SelectionRange[] array

The one-dimensional array that is the destination of the elements copied from the SelectionRangeCollection. The array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in the destination array at which storing the copied elements begins.

GetEnumerator()

Returns an enumerator that iterates through the selection range collection.

Declaration
public IEnumerator<SelectionRange> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<SelectionRange>

An enumerator that can be used to iterate through the SelectionRangeCollection.

Remove(SelectionRange)

Removes a specified selection range from the collection.

Declaration
public bool Remove(SelectionRange item)
Parameters
SelectionRange item

The selection range to be removed from the collection.

Returns
System.Boolean

Returns a boolean indicating whether the removal was successful.

SortDescending()

Sorts the collection of selection ranges in descending order.

Declaration
public SelectionRangeCollection SortDescending()
Returns
SelectionRangeCollection

A collection of selection ranges sorted in descending order.

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.