This is a migrated thread and some comments may be shown as answers.

Edit cell context menu

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
LCCICT
Top achievements
Rank 1
LCCICT asked on 05 Sep 2017, 10:59 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 06 Sep 2017, 06:50 AM
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.
Tags
GridView
Asked by
LCCICT
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or