Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

HtmlEdit.SelectionRange Property

Gets or sets the HtmlSelectionRange object that stores the selection’s start character index and selection length. This is a bindable property.

Namespace: DevExpress.Maui.HtmlEditor

Assembly: DevExpress.Maui.HtmlEditor.dll

NuGet Package: DevExpress.Maui.HtmlEditor

#Declaration

C#
public HtmlSelectionRange SelectionRange { get; set; }

#Property Value

Type Description
HtmlSelectionRange

The HtmlSelectionRange object that stores the selection’s start character index and selection length.

#Remarks

The following code snippet defines HTML markup and selects its first 15 characters:

public partial class MainPage : ContentPage {
    public MainPage() {
        InitializeComponent();
        Init();
    }
    async void Init() {
        string text = "<h2>Search Input Field</h2><p>When it comes to locating text-based items quickly, a simple search input field proves to be remarkably effective.</p>";
        await htmledit.SetHtmlSourceAsync(text);
        htmledit.SelectionRange = new SelectionRange(0,18);
    }
}
See Also