Completed
Last Updated: 07 Jun 2021 15:03 by ADMIN
Release R2 2021 SP1
devops
Created on: 13 May 2021 10:49
Category: TextBoxControl
Type: Bug Report
0
RadSpellChecker: Stack Overflow when setting the AutoSpellCheckControl property constantly

This is the code that simulates multiple assigning of the spell-checked control: 

public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent(); 

        this.textBox1.MouseEnter += Control_Enter;
        this.textBox1.MouseLeave += Control_Leave;

    }

    bool hasLoop = false;
    private void Control_Enter(object sender, EventArgs e)
    {
        radSpellChecker1.AutoSpellCheckControl = sender;
        if (hasLoop)
        {
            return;
        }
        for (int i = 0; i < 1000; i++)
        {
            if (i % 2 == 0)
            {
                radSpellChecker1.AutoSpellCheckControl = null;
            }
            else
            {
                radSpellChecker1.AutoSpellCheckControl = sender;
            }

        }
        hasLoop = true;
    }

    private void Control_Leave(object sender, EventArgs e)
    {
        radSpellChecker1.AutoSpellCheckControl = null;
    }
}

2 comments
ADMIN
Nadya | Tech Support Engineer
Posted on: 14 May 2021 09:54

Hello,

Thank you for sharing your insights. It is much appreciated. This item is planned for the upcoming service pack of R2 2021 so our developers would investigate the issue precisely and fix it accordingly.

In case you have any further questions or concerns do not hesitate to contact us. 

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

devops
Posted on: 14 May 2021 02:30
The bug occurs in TextBoxAdaptor, which is set in AutoSpellCheckControl -> SetAutoSpellChecker -> SetAssociatedTextBox -> CurrentControl -> TextBoxAdaptor

In TextBoxAdaptor constructor, handle is assigned, but not release when reassigning TextBoxBase control to AutoSpellCheckControl.

My workaround is release any existing handle before assigning a new one.