0
votes

I have a devexpress xtraGrid. One column is editable. When I select the text in this column and right click, a menu will pop up. There are "Undo, Cut, Copy, Paste, Delete and Select All" in this menu.

Looks like if I use for example "cut" button to cut all text in the cell, the gridviewcellvaluechaning event is not fired. And we have our own customized right click popup menu as well. I want to disable the xtragrid default one, but I search for a while didn't find useful information. Any guidance is really appreciated!

Thanks!

2

2 Answers

1
votes

From http://www.devexpress.com/Support/Center/p/CQ31618.aspx

    ContextMenu emptyMenu = new ContextMenu();
        this.components.Add(emptyMenu);

    private void gridView1_ShownEditor(object sender, System.EventArgs e) {
        DevExpress.XtraGrid.Views.Grid.GridView view = 
                           sender as DevExpress.XtraGrid.Views.Grid.GridView;
        if(!view.IsFilterRow(view.FocusedRowHandle)) return;
        view.ActiveEditor.ContextMenu = emptyMenu;
    }
1
votes

It is possible to clear default menu items and append your own ones within the BeforeShouwMenu event handler of the RepositoryItem instance.