Search code examples
c#devexpressopenfiledialog

How to disable Right Click in Devexpress XtraOpenFileDialog?


I am using devexpress openFileDialog which is called XtraOpenFileDialog. I need to disable Right Click in this control but can't a way for do that! There is no property or event to handle that. Does anybody know about this problem? Thanks


Solution

  • There currently is no way to disable the default right-click context menu in the DevExpress dialogs.

    If you have a subscription that allows access to the source code you can disable the invocation of the ShowContextMenu method in the ViewController class's MouseUp method.

    public void MouseUp(MouseButtons mouseButtons, IContextMenuProvider contextMenuProvider) {
        if((mouseButtons & MouseButtons.RightButton) == MouseButtons.RightButton) {
            ShowContextMenu(contextMenuProvider);  //Remove this
        }
    }