Edit cell context menu

2 posts, 0 answers
  1. LCCICT
    LCCICT avatar
    3 posts
    Member since:
    Aug 2016

    Posted 05 Sep 2017 Link to this post

    Hi Telerik,

    I have been able to modify and add context menus to cells. However when the cell is being edited and I right click on it gives me a context menu that I can't seem to modify. Could you tell me how I can replace this context menu?

    Cheers

     

    Phil.

  2. Dimitar
    Admin
    Dimitar avatar
    2831 posts

    Posted 06 Sep 2017 Link to this post

    Hi Phil,

    The editor is actually a text box (the standard .Net one) and it has another context menu. You can disable it by accessing the text box in the CellEditorInitialized event handler:
    private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        var editor = e.ActiveEditor as RadTextBoxEditor;
        if (editor != null)
        {
            var element = editor.EditorElement as RadTextBoxEditorElement;
            var textBox = element.TextBoxItem.HostedControl as HostedTextBoxBase;
            textBox.ContextMenu = new ContextMenu();
        }
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top