Completed
Last Updated: 27 Aug 2013 05:19 by ADMIN
ADMIN
Stefan
Created on: 27 Aug 2013 05:19
Category: Editors
Type: Bug Report
0
FIX. RadTextBoxControl - cut, delete and paste items should not be enabled in read only mode
To reproduce - add some text to the control and its IsReadOnly to true. Right click and observe the context menu

Workaround:
        radTextBoxControl1.ContextMenuOpening += radTextBoxControl1_ContextMenuOpening;
        

        void radTextBoxControl1_ContextMenuOpening(object sender, TreeBoxContextMenuOpeningEventArgs e)
        {
            e.ContextMenu.DropDownOpened -= ContextMenu_DropDownOpened;
            e.ContextMenu.DropDownOpened += ContextMenu_DropDownOpened;
          
        }

        void ContextMenu_DropDownOpened(object sender, EventArgs e)
        {
            TextBoxControlDefaultContextMenu contextMenu = (TextBoxControlDefaultContextMenu)sender;

            if (radTextBoxControl1.IsReadOnly)
            {
                foreach (RadMenuItemBase item in contextMenu.Items)
                {
                    if (item.Text == "Cu&t" ||
                        item.Text == "&Copy" ||
                        item.Text == "&Paste" ||
                        item.Text == "&Delete")
                    {
                        item.Enabled = false;
                    }
                }
            }
        }
0 comments