Ticket T486898
Visible to All Users

The context menu invoked for WinForms ListEditor is not closed after reloading View controls from the Application Model (S173664) from SingleChoiceAction with ItemType = ItemIsMode

created 8 years ago

[DevExpress Support Team: CLONED FROM S173664: How to refresh View appearance after making changes to the Application Model in code]
If you invoke the SwitchMasterDetailMode action from the context menu (WinForms), the context menu stays open

Show previous comments (2)
Dennis Garavsky (DevExpress) 8 years ago

    Hello Andreas,

    Thanks for making this sample.
    I can replicate this behavior, because I used SimpleAction while you are doing it with SingleChoiceAction, which creates another drop-down sub-menu from the context one.
    Good news is that there is a temporarily solution with ItemType = ItemIsOperation. Anyway, we will research this situation and see if this can be easily improved with or without writing platform-dependent code. This appears to be a tricky problem related to the WinForms framework and our XtraBars library controls, so our research can take significant time. Your patience is greatly appreciated.

    AM AM
    Andreas Mummenhoff 8 years ago

      Hello Dennis,

      yes,but this controller was working for years. Since the code was somewhat like a hack, I thought it might be a good idea to use now this official approach. Before it was:
      - Store current object
      - Update model
      - If View.IsRoot
          Frame.SetView(Application.ProcessShortcut(Frame.View.CreateShortcut()), true, Frame)
      else
         View.LoadModel()
      - Restore current object

      It was not perfect, but there was no flicker and the context menu was closed. Maybe this info helps also.

      Dennis Garavsky (DevExpress) 8 years ago

        Thanks for your update, Andreas.

        Answers approved by DevExpress Support

        created 8 years ago (modified 8 years ago)

        Thank you for your feedback.
        I have investigated your project and found that in your configuration, an end user will expect that the shown popup menu will be hidden immediately when a ComboBox editor value is changed.
        Unfortunately, we have not investigated this configuration and don't have a built in option to enable this behavior. We will see how to improve this situation, though I cannot promise any time frame.
        Currently, I suggest that you manually hide the shown popup menu:

        C#
        Private Function SetMasterDetailKind(tKind As ajmMasterDetailKindNr) As Boolean Try Dim tView As ListView = View Dim tModel As IModelListView = tView?.Model Dim tCurrent = tView.CurrentObject If Not Frame.SetView(Nothing, True, Nothing, False) Then Return False Else Dim contextMenuHolder As IContextMenuHolder = TryCast(Frame.Template, IContextMenuHolder) If contextMenuHolder IsNot Nothing And contextMenuHolder.ContextMenu IsNot Nothing Then contextMenuHolder.ContextMenu.HidePopup() End If

        See the attached project for a complete solution.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.