Unplanned
Last Updated: 30 Mar 2016 12:56 by ADMIN
ADMIN
Hristo
Created on: 12 Nov 2015 15:38
Category: RichTextEditor
Type: Bug Report
1
FIX. RadRichTextEditor - context menu still shows up even when IsContextMenuEnabled is set to false if FindNextError button is clicked in ribbon
How to reproduce:
public Form1()
        {
            InitializeComponent();

            richTextEditorRibbonBar1.AssociatedRichTextEditor = radRichTextEditor1;
            radRichTextEditor1.Insert("This is a example for the \"ContextMenu shows up even when disabled\" error. If you right click on a word nothing happens (just as it is supposed to be) now klick \"Find Next Error\" and there it is (not supposed to be)\n\nlkjds klsdjfio jlk sdjfi lsdifuioew rlsoidf  sjdiuf oipds jifpodsuf ");

            radRichTextEditor1.IsContextMenuEnabled = false;
        }

        private void dropdown_PopupOpening(object sender, CancelEventArgs args)
        {
            args.Cancel = true;
        }

Workaround: 
public Form1()
        {
            InitializeComponent();

            richTextEditorRibbonBar1.AssociatedRichTextEditor = radRichTextEditor1;
            radRichTextEditor1.Insert("This is a example for the \"ContextMenu shows up even when disabled\" error. If you right click on a word nothing happens (just as it is supposed to be) now klick \"Find Next Error\" and there it is (not supposed to be)\n\nlkjds klsdjfio jlk sdjfi lsdifuioew rlsoidf  sjdiuf oipds jifpodsuf ");

            radRichTextEditor1.IsContextMenuEnabled = false; 

            FieldInfo fi = this.radRichTextEditor1.RichTextBoxElement.ContextMenu.GetType().GetField("radDropDownMenu", BindingFlags.Instance | BindingFlags.NonPublic);
            RadDropDownMenu dropdown = fi.GetValue(this.radRichTextEditor1.RichTextBoxElement.ContextMenu) as RadDropDownMenu;
            if (dropdown != null)
            {
                dropdown.PopupOpening += dropdown_PopupOpening;
            }
        }

        private void dropdown_PopupOpening(object sender, CancelEventArgs args)
        {
            args.Cancel = true;
        }
0 comments