New to Telerik UI for WPFStart a free 30-day trial

Touch

Updated on Sep 15, 2025

The RadSyntaxEditor comes with out-of-the-box support for touch gestures.

When using touch, touch selector markers appear when the user taps on the editor. Swiping 30 pixels around them moves the selection's start/end. Switching to a mouse device hides the markers. The markers are also hidden during a swipe or pinch. Swiping over the line numbers selects each of the lines the swipe passes over.

RadSyntaxEditor Touch Support

Supported Touch Gestures

GestureRadSyntaxEditor Action
TapMoves the caret under the finger
Double TapSelects the word under the finger
PinchScales the document (the ScaleFactor changes)
SwipeScrolls the document
Swipe inertiaScrolls the document continuously with increased speed

Override Default Touch Logic

If you wish to implement your own touch logic, you can override the InitializeTouch method of the RadSyntaxEditor.

Example 1: Default InitializeTouch method

C#

        protected override void InitializeTouch(SyntaxEditorPresenter presenter)
        {
            TouchManager.AddSwipeEventHandler(presenter, new SwipeEventHandler(OnSwipe));
            base.InitializeTouch(presenter);
        }

        private void OnSwipe(object sender, SwipeEventArgs args)
        {
            // your custom logic for swiping
            args.Handled = true; // you can omit this if your custom logic does not contradict with the default logic
        }

You can read the following article article, which describes all of the events exposed by the TouchManager.

Increase Markers Drag Area

By default, dragging the markers is possible if the swipe occurs up to 30 pixels from their center. This area can be controlled via the TouchMarkerDragDistance property of the RadSyntaxEditor control.

Example 2: Increase markers drag area

C#

    this.syntaxEditor.TouchMarkerDragDistance = 40;

See Also