Ticket T552973
Visible to All Users

SingelChoiceAction with ItemType = ItemIsMode is shown as ItemIsOperation in the Tools group

created 7 years ago

Hi Guys,

i have a singlechoiceaction with some items. the action is per default ItemTyp = Mode. when i place the action to the PredefinedCategory.View for example - then it is correctly an combobox - when i move the action to the tools container it does not show an combobox anymore?

see screen

Comments (1)

    Hi Martin,

    Not sure if this is it. But check the MainRibbonForm and DetailRibbonForm templates. On my test project the barContainerTools.IsMenuMode is set to true while the barContainerEdit.IsMenuMode is set to false. See attached screenshot.

    HTH

    Alex

    Answers

    created 7 years ago (modified 4 years ago)

    Alex is right, the type of the created bar item depends on the action container's IsMenuMode property. If this property is 'True', the container treats all SingelChoiceActions as 'ItemIsOperation' regardless of their ItemType.
    There are two ways to change the default behavior:

    1. Customize a container using the ActionControlsSiteController.CustomizeContainerActions event:
    C#
    using DevExpress.ExpressApp; using DevExpress.ExpressApp.SystemModule; using DevExpress.ExpressApp.Win.Templates.Bars.ActionControls; namespace dxT963770.Module.Win.Controllers { public class CustomizeContainerActionsController : Controller { protected override void OnActivated() { base.OnActivated(); Frame.GetController<ActionControlsSiteController>().CustomizeContainerActions += OnCustomizeContainerActions; } protected override void OnDeactivated() { Frame.GetController<ActionControlsSiteController>().CustomizeContainerActions -= OnCustomizeContainerActions; base.OnDeactivated(); } private void OnCustomizeContainerActions(object sender, CustomizeContainerActionsEventArgs e) { if(e.Category == "Tools") { ((BarLinkActionControlContainer)e.Container).IsMenuMode = false; } } } }
    1. Create a custom LightStyleMainRibbonForm and DetailRibbonForm templates as described at How to: Create a Custom WinForms Ribbon Template. After that, find the required 'barActionContainer…' (the 'barActionContainerTools' for the 'Tools' category) and change its IsMenuMode in the designer.

    Thanks,
    Anatol

      Comments (3)
      M M
      Martin Praxmarer - DevExpress MVP 7 years ago

        Thx Anatol - any reason for this behaviour?

        Anatol (DevExpress) 7 years ago

          I need to consult with our developers about this feature. They are not available now, so I will answer you after the weekend. Please accept my apologies for the delay.

          DevExpress Support Team 7 years ago

            Hello Martin,

            Starting with v14.2, the IsMenuMode property replaces the ActionContainerMenuBarItem class from the old templates. So, the behavior is the same when BarLinkActionControlContainer is used with IsMenuMode=true in new templates and the ActionContainerMenuBarItem class is used instead of the ActionContainerBarItem class in the old templates.

            The ActionContainerMenuBarItem class was introduced for containers that are intended to display SingleChoiceActions items as operations (for example, Panels, ViewsNavigation, Tools). It is also assumed that any other action in the meaning of these categories should be better displayed as operations. If this assumption is wrong for your situation, you can change the IsMenuMode property as Anatol described.

            Thanks,
            Marina

            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.