Ticket T570804
Visible to All Users

How to join multiple actions to a single dropdown menu as this is done for the Save action

created 7 years ago

Hi,
I have two simple actions which each of them have individual set of property especially for different target object setting.  This allow enable / disable of the button according to different criteria.

How can i integrated it and behave like to single choice action which i will put all the action like a drop down list. Please help. thx

Answers approved by DevExpress Support

created 7 years ago (modified 6 years ago)

Hello Horace,

To show a drop-down menu with multiple actions, use the WebActionContainer.IsDropDown option. This option can be set in the page template. For example, to customize the main window, create a custom Default Vertical Template Content and add a new WebActionContainer item to its main toolbar as shown below:

ASPx
<cc3:XafUpdatePanel ID="UPTB" runat="server"> <cc2:ActionContainerHolder CssClass="ACH MainToolbar" runat="server" ID="TB" ContainerStyle="ToolBar" Orientation="Horizontal"> ... <ActionContainers> ... <cc2:WebActionContainer ContainerId="MainMenuDropDown" IsDropDown="true" DefaultItemCaption="Action" /> .... </ActionContainers> </cc2:ActionContainerHolder> </cc3:XafUpdatePanel>

Then, place your actions to this container, as described in the Place an Action in a Different Location topic.
Other options available for the IsDropDown mode are described in the In the ASP.NET template markup section of the Action Containers topic.

Also, the IsDropDown option of an existing Action Container can be set in code without creating a custom template: New Web.UI - how to hide Save and SaveAndNew actions, but keep SaveAndClose

In addition, note that you can manage SingleChoiceAction's items availability using the ChoiceActionItem.Active and ChoiceActionItem.Enabled properties. To learn how to change them depending on the current object, refer to the How to: Access Objects Selected in the Current View topic.

    Show previous comments (3)
    Anatol (DevExpress) 6 years ago

      Hello Horace,

      You are right - in the current version, this dropdown is not shown for one item. We have planned this behavior's improvement in the context of the following ticket: Security - The My Details action is not available in the My Account menu with AuthenticationActiveDirectory. Please add it to your Favorites to be notified of its changes.
      As a temporary solution, you can clear your WebActionContainer's DefaultItemCaption property and (optionally) set its AutoChangeDefaultAction property to true. In this case, the Exclude Invoice caption will be displayed in this menu item, just like in the Save menu.

        Hi,
        I have built a dropdown menu container for some actions button using DefaulttemplateContent as above.  It was showing ok for listview.  However, if for nested listview, the dropdown menu cannot be shown.  What should i do so that the nested listview in the master detailview will have the dropdown menu action button also?
        Pls check attached and support. thx

        DevExpress Support Team 6 years ago

          Hi Horace,

          Nested List Views use the Nested Frame Control template. It's necessary to create a custom NestedFrameControl template and add your custom action container to it. I suggest you review the Templates article that lists what templates are used and where.

          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.