Skip to main content

PivotGridControl.ShowingCustomizationForm Event

Occurs before the Customization Form is displayed.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v23.2.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public event CustomizationFormShowingEventHandler ShowingCustomizationForm

Event Data

The ShowingCustomizationForm event's data class is CustomizationFormShowingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the standard Customization Form should be canceled.
CustomizationForm Provides access to the Customization Form.
Handled Obsolete. Gets or sets whether the standard Customization Form should be canceled.
ParentControl Gets or sets the control to which the Customization Form belongs.

Remarks

The ShowingCustomizationForm event occurs before the Customization Form is displayed. It allows the form to be customized or replaced with a custom form.

The CustomizationFormShowingEventArgs.CustomizationForm parameter refers to the standard Customization Form which is about to be displayed. If the event’s CustomizationFormShowingEventArgs.Cancel parameter is set to true the standard Customization Form will not be displayed. The CustomizationFormShowingEventArgs.ParentControl parameter specifies the control (PivotGrid control) which owns the form.

After the standard Customization Form has been invoked the PivotGridControl.ShowCustomizationForm event is raised.

Example

This example demonstrates how to display the Customization Form near the Pivot Grid.

Standalone Customization Form

The form is in SplitContainerControl - a parent container for the Pivot Grid and Customization Form. To specify the SplitContainer’s panel as the Customization Form’s owner, handle the PivotGridControl.ShowingCustomizationForm event and use the e.ParentControl property.

Specify the form’s appearance with the PivotGridOptionsCustomization.CustomizationFormStyle property.

Call the FieldsCustomization method to show the form.

using System;
using System.Windows.Forms;

namespace StandaloneCustomForm {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e) {
            excelDataSource1.FileName = "SalesPerson.xlsx";
            excelDataSource1.Fill();

            // Set the Customization Form style and show the form.
            pivotGridControl1.OptionsCustomization.CustomizationFormStyle = 
                DevExpress.XtraPivotGrid.Customization.CustomizationFormStyle.Excel2007;
            pivotGridControl1.FieldsCustomization();
        }
        private void pivotGridControl1_ShowingCustomizationForm(object sender, 
            DevExpress.XtraPivotGrid.CustomizationFormShowingEventArgs e) {
            // Set the control that owns the Customization Form.
            e.ParentControl = splitContainerControl1.Panel2;

            e.CustomizationForm.Dock = DockStyle.Fill;
        }
    }
}
See Also