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
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class TextSelection

Represents text selection.

Inheritance
System.Object
TextSelection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Documents.Fixed.Selection
Assembly: Telerik.Windows.Documents.Fixed.dll

Syntax

public class TextSelection

Properties

EndPosition

Gets the end position of the selection.

Declaration
public TextPosition EndPosition { get; }
Property Value
TextPosition

The end position.

IsEmpty

Gets a value indicating whether the selection is empty (contains no text).

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

true if the start and end positions are the same; otherwise, false.

StartPosition

Gets the start position of the selection.

Declaration
public TextPosition StartPosition { get; }
Property Value
TextPosition

The start position.

Methods

Clear()

Clears the selection.

Declaration
public void Clear()

GetSelectedText()

Gets the selected text.

Declaration
public string GetSelectedText()
Returns
System.String

A string containing the text content within the current selection, or an empty string if no text is selected.

GetSelectedTextAsync()

Gets the selected text asynchronously.

Declaration
public Task<string> GetSelectedTextAsync()
Returns
System.Threading.Tasks.Task<System.String>

A task that represents the asynchronous operation. The task result contains the text content within the current selection.

GetSelectionGeometry(RadFixedPage)

Gets the path geometry representing the visual bounds of the text selection on the specified page.

Declaration
public PathGeometry GetSelectionGeometry(RadFixedPage page)
Parameters
RadFixedPage page

The page for which to retrieve the selection geometry.

Returns
System.Windows.Media.PathGeometry

A PathGeometry object representing the visual bounds of the text selection on the specified page.

Remarks

The geometry can be used for highlighting or other visual representations of the selected text.

SelectAll()

Selects the whole document.

Declaration
public void SelectAll()

SetSelection(TextPosition, TextPosition)

Sets the selection.

Declaration
public void SetSelection(TextPosition startPosition, TextPosition endPosition)
Parameters
TextPosition startPosition

The start position.

TextPosition endPosition

The end position.

SetSelectionEnd(TextPosition)

Sets the selection end.

Declaration
public void SetSelectionEnd(TextPosition endPosition)
Parameters
TextPosition endPosition

The end position.

SetSelectionStart(TextPosition)

Sets the selection start.

Declaration
public void SetSelectionStart(TextPosition startPosition)
Parameters
TextPosition startPosition

The start position.

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
System.String

A string that represents the current object.

Overrides
System.Object.ToString()

Events

SelectionChanged

Occurs when selection is changed.

Declaration
public event EventHandler SelectionChanged
Event Type
System.EventHandler

SelectionChanging

Occurs when selection is changing.

Declaration
public event EventHandler SelectionChanging
Event Type
System.EventHandler

Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • 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.