Skip to main content
A newer version of this page is available. .

PivotCellEventArgs Class

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v18.2.dll

Declaration

public class PivotCellEventArgs :
    PivotCellBaseEventArgs

Remarks

The PivotGridControl.CellClick and PivotGridControl.CellDoubleClick events occur when an end-user clicks or double-clicks a pivot grid cell, respectively. To obtain which mouse button has been clicked, use the PivotCellEventArgs.Button property.

Example

The PivotGridControl supports the drill-down capability, which enables you to retrieve a list of records that can be used to calculate a particular summary. To obtain drill-down data, use the PivotGridControl‘s PivotCellBaseEventArgs.CreateDrillDownDataSource method. Its parameters completely identify a summary cell.

In this example, an end-user can view records from the control’s underlying data source, associated with a summary cell, by double-clicking it. The obtained data is displayed by the DXGrid within a popup window.

using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using DevExpress.Mvvm.POCO;
using DevExpress.Xpf.PivotGrid;
using HowtoObtainUnderlyingData.NwindDataSetTableAdapters;

namespace HowtoObtainUnderlyingData {
    [POCOViewModel]
    public class ViewModel {
        NwindDataSet.SalesPersonDataTable salesPersonDataTable = new NwindDataSet.SalesPersonDataTable();
        SalesPersonTableAdapter salesPersonDataAdapter = new SalesPersonTableAdapter();

        public NwindDataSet.SalesPersonDataTable DataSource { get { return salesPersonDataTable; } }

        protected ViewModel() {
            salesPersonDataAdapter.Fill(salesPersonDataTable);
        }

        public void ShowDrillDownData(CellInfo cellInfo) {
            this.GetService<IDialogService>().ShowDialog(MessageButton.OK, "Drill Down Results", cellInfo);
        }
    }
}
See Also