Completed
Last Updated: 23 Nov 2021 09:48 by ADMIN
Release R3 2021 SP2
Ashish
Created on: 15 Nov 2021 14:15
Category: RichTextEditor
Type: Bug Report
3
RadRichTextEditor: The mention box and context cause a runtime exception when there are no suggestions

Hi Sir,

We updated telerik and facing some issues with that.

in new update with rich text editor has new property called  MentionBox settings of that auto added in to designer code. 

which creates an error when we run the application.

following line is auto added.

mentionBox1.FocusedItemIndex = -1;

 

we have to comment every time after doing UI changes. and we need to check every time whether that line is commented or not. 

 

Please Help Us.

Thanks,

Ashish.

3 comments
ADMIN
Hristo
Posted on: 19 Nov 2021 12:01

Hi,

The issue causes great trouble in projects with the RadRichTextEditor. We are releasing a SP with the fix next week.

Regards,
Hristo
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.

Al
Posted on: 17 Nov 2021 23:57
I will add that I also have this issue and it is very time consuming. I urge a quick fix to this one please. 
ADMIN
Hristo
Posted on: 15 Nov 2021 15:26

Hello Ashish,

I have converted your ticket to a bug report and I have exposed it publicly on our feedback portal. You can subscribe to it and be updated whenever its status changes. The item is already being investigated. I have also updated your Telerik points for this report.

I confirm that the issue is caused by the introduction of the new mentions in the RadRichTextEditor. The FocusedItemIndex property of the mention box is causing it because there are no mention items. The actual problem is that the MentionBox and MentionContext objects should have never been serialized in the designer file. Please excuse us for this inconvenience.

A possible workaround is to create a custom RadRichTextEditor control and override the MentionBox and MentionContext properties this way:

public class MyRadRichTextEditor : RadRichTextEditor
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadRichTextEditor).FullName;
        }
    }

    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public new MentionContext MentionContext
    {
        get
        {
            return base.MentionContext;
        }
        set
        {
            base.MentionContext = value;
        }
    }

    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public new IMentionBox MentionBox
    {
        get
        {
            return base.MentionBox;
        }
        set
        {
            base.MentionBox = value;
        }
    }
}

In order to apply the workaround you will need to first go in your designer files and delete the mention box and context objects:

Then you will need to change the instance of the RadRichTextEditor control to be the one of the custom type with the hidden properties.

I am also attaching my test project as an example.

I have increased the priority of the item and a fix for it will be available with our next internal lib. Until then I hope that you could use the suggested workaround. Let us know if you will need further assistance.

Regards,
Hristo
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.

Attached Files: