This is a migrated thread and some comments may be shown as answers.

Completion window does not open on proper location

1 Answer 19 Views
SyntaxEditor
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
n/a asked on 12 Aug 2020, 10:42 AM

Hello,

I have problem with completion window location when vertical scroll of SyntaxEditor is not at start position. In that case position of completion window is at the top of control, in same case, somewhere else. I reproduced such behavior on minimal example which I am sharing with you right now.

 

using System.Windows.Forms;
using Telerik.WinForms.Controls.SyntaxEditor.UI.IntelliPrompt.Completion;
 
namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
 
            ICompletionInfoCollection completionInfoCollection = new CompletionInfoCollection
            {
                new CompletionInfo("AAA", "A description."),
                new CompletionInfo("BBB", "B description."),
                new CompletionInfo("CCC", "C description.")
            };
 
            var completionListWindow = this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.CompletionListWindow;
            completionListWindow.Presenter.CompletionListItems = completionInfoCollection;
        }
 
        private void radSyntaxEditor1_DocumentContentChanged(object sender, Telerik.WinForms.SyntaxEditor.Core.Text.TextContentChangedEventArgs e)
        {
            Telerik.WinForms.Controls.SyntaxEditor.UI.CompletionListPopup completionListWindow = this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.CompletionListWindow;
            completionListWindow.Show();
            completionListWindow.Refresh();
        }
 
    }
}

As you can see in the images, in the first two cases everything is ok, but in the third image, when the vertical scroll is not at the start position (moved a little bit), the completion window has a completely wrong place.

Thank you for your answers.

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 12 Aug 2020, 10:45 PM

Hello Veljko,

After looking through the problematic sources, I found several issues that will need addressing. The problem is valid not only for the CompletionListWindow, but also for the OverloadListWindow. I have logged an issue in our feedback portal and you can keep track of it there, post a comment and follow it.

I have also updated your Telerik points.

While we are dealing with the bug, here is a workaround that may help you. You will have to set the IsAutoClose property of the window to false. Currently we have problems with it. After that you will have to manually take care of closing the window (for example closing the window on mouse click). Here is a code snippet that is illustrating this:       

        public Form1()
        {
            InitializeComponent();

            OverloadInfoCollection overloadListA = new OverloadInfoCollection
            {
                new OverloadInfo("AAA", "A description"),
                new OverloadInfo("BBB", "B description"),
                new OverloadInfo("CCC", "C description")
            };
            this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Presenter.OverloadListItems = overloadListA;
            this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.IsAutoClose = false;
            this.radSyntaxEditor1.Click += RadSyntaxEditor1_Click;
        }

        private void RadSyntaxEditor1_Click(object sender, EventArgs e)
        {
            this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.OverloadListWindow.Close();
        }

You can define your own custom logic, when to close the OverloadListWindow/CompletionListWindow. 

I hope this will solve your issue. If you have further question, do not hesitate to contact me.

Regards, Stoyan Progress Telerik

Tags
SyntaxEditor
Asked by
n/a
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or