Back to Devexpress

HtmlEdit.SelectionRange Property

maui-devexpress-dot-maui-dot-htmleditor-dot-htmledit-bed3a17a.md

latest1.6 KB
Original Source

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

csharp
public HtmlSelectionRange SelectionRange { get; set; }

Property Value

TypeDescription
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:

csharp
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

HtmlEdit Class

HtmlEdit Members

DevExpress.Maui.HtmlEditor Namespace