Ticket T606370
Visible to All Users

How to display the Export and other ListView Actions in a popup template

created 7 years ago

[DevExpress Support Team: CLONED FROM T604959: How to log Export and Print Preview Actions by the Audit Trail module]
i have controller with popupaction
where I want display audit records for current object::

C#
private void popupWindowAuditKlienci_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { ListView lv = Application.CreateListView(Application.CreateObjectSpace(typeof(AuditDataItemPersistent)), typeof(AuditDataItemPersistent), true); GroupOperator criteria = new GroupOperator(GroupOperatorType.And); criteria.Operands.Add(new BinaryOperator("AuditedObject.TargetType", ((XPObjectSpace)ObjectSpace).Session.GetObjectType(View.CurrentObject))); criteria.Operands.Add(new BinaryOperator("AuditedObject.TargetKey", XPWeakReference.KeyToString(ObjectSpace.GetKeyValue(View.CurrentObject)))); lv.CollectionSource.Criteria["ByTargetObject"] = criteria; e.View = lv; }

…and when I run this I get list f audit entries, but I can't export this list to excel or pdf  like on standard listView

Answers approved by DevExpress Support

created 7 years ago (modified 4 years ago)

Hello,

PopupWindowShowAction displays a View in a template that does not contain the Export and other Actions by default due to the design of Action Containers in this template: Concepts > UI Construction > Templates

The simplest solution here would be showing a regular (non-popup) window using a SimpleAction. Handle its Execute event and customize the ActionBaseEventArgs.ShowViewParameters object as required. To specify a Template context for the target Window, specify the Context property to TemplateContext.View or other. Research the Concepts > UI Construction > Views > Ways to Show a View  and related concepts for more details.

Alternatively, you can customize the default Action Containers set for the popup window using the Model Editor or WinForms designer. Refer to points 2 and 3 in the S19503 article:

To achieve the UI above, I customized the Application Model as follows (approach #3 from the reference article):

XML
<ActionToContainerMapping> <ActionContainer Id="PopupActions"> <ActionLink ActionId="Export" IsNewNode="True" /> <ActionLink ActionId="PrintPreview" IsNewNode="True" /> </ActionContainer> </ActionToContainerMapping>

This will add these Actions in ALL popup windows, so you may want to disable them for unwanted Views (ActionBase > Active ).

    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.