Unplanned
Last Updated: 23 Jan 2026 12:23 by Martin Ivanov
Martin Ivanov
Created on: 23 Jan 2026 12:23
Category: SyntaxEditor
Type: Bug Report
0
SyntaxEditor: Wrong position of the IntelliPrompt popup on monitors with different DPI scale

The position of the popup representing the IntelliPrompt is wrong when shown on the monitor with the higher DPI scale, in a setup with two monitors with different DPI settings. For example, if one monitor has 100% DPI scale and the other 125%, the position of the popup will be wrong when the app is on the 125% monitor.

To work this around, use the Caret visual as the PlacementTarget for the popup and set its offsets to 0 after it is shown.

 private void RadSyntaxEditor_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (KeyboardModifiers.IsControlDown && e.Key == Key.Space)
     {		
        e.Handled = true;

		var editor = (RadSyntaxEditor)sender;
        CaretPosition startPosition = new CaretPosition(editor.CaretPosition);
        CaretPosition endPosition = new CaretPosition(editor.CaretPosition);
        editor.IntelliPrompts.CompletionListWindow.Show(startPosition, endPosition);
		editor.IntelliPrompts.CompletionListWindow.HorizontalOffset = 0;
		editor.IntelliPrompts.CompletionListWindow.VerticalOffset = 0;
     }
 }

 private void RadSyntaxEditor_Loaded(object sender, System.Windows.RoutedEventArgs e)
 {
    var editor = (RadSyntaxEditor)sender;
    var caret = editor.FindChildByType<Telerik.Windows.Controls.SyntaxEditor.UI.Caret>();
    editor.IntelliPrompts.CompletionListWindow.PlacementTarget = caret;
    editor.IntelliPrompts.CompletionListWindow.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
 }

0 comments