Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
ContextMenu closes as soon as it opens on xamDialogWindow
posted

Hi,

I have placed text boxes and a XamDataGrid on a XamDialogWindow. I have set IsModal property of the XamDialogWindow to true and I have added ContextMenu On DataRecordPresenter of the grid.When I reight click on the grid, the contextMenu opens for a very brief time (few miliseconds) and then disappears. If the IsModal property is set to false, then it works just fine. I'm attaching a sample project. In this project my styling for XamDataGrid is done in XamDataGridStyle.xaml file. In ModalWindow if we put grid in scrollviewer. The scrollviewer contextmenu shows same behavior as well. A snapshot of snoop events for contextmenuopening and contextmenuclosing is also attached.
Your help will be appreciated.

InfragisticsDialogWindowIssue.zip
Parents
No Data
Reply
  • 34790
    Verified Answer
    Offline posted

    Hello Gottfried,

    Thank you for your post.

    I have been investigating into this issue and I have reproduced the behavior that you are seeing. Strangely, this appears to only happen with certain controls, such as the XamDataGrid. Placing a context menu on a Button element or something of the like seems to work correctly whether or not the dialog is modal. I am not entirely sure as of yet why the ContextMenu is closing instantly after being opened, but I am still investigating into this issue. I believe that the issue is likely happening because the ContextMenu itself is essentially a popup, and modal dialogs are meant to keep focus on themselves, so perhaps that is why the ContextMenu is not being opened.

    Something that is a bit strange is that the Infragistics context menu, the XamContextMenu, seems to work in this case. For the time being, I would recommend that you use the XamContextMenu instead of the built-in WPF one. You can read more about the XamContextMenu in our online documentation article about it, here: http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=xamContextMenu.html.

    I have also attached a sample project demonstrating the usage of a XamContextMenu on the DataRecordPresenter of a XamDataGrid. I hope this helps.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamDialogWindowModalContextMenu.zip
Children