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
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:
<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.