PivotGridControl.CellDoubleClick Event

Occurs when a cell is double-clicked.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v20.1.dll

Declaration

public event PivotCellEventHandler CellDoubleClick
Public Event CellDoubleClick As PivotCellEventHandler

Event Data

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

Property Description
Button Gets which mouse button has been clicked.
ColumnCustomTotal Gets the custom total to which the processed cell's column corresponds. Inherited from PivotCellBaseEventArgs.
ColumnField Gets the innermost column field which corresponds to the processed cell. Inherited from PivotCellBaseEventArgs.
ColumnFieldIndex This member supports the internal infrastructure and is not intended to be used directly from your code. Inherited from PivotCellBaseEventArgs.
ColumnIndex Gets the visual index of the column that contains the processed cell. Inherited from PivotCellBaseEventArgs.
ColumnValueType Gets the type of the cell's column header. Inherited from PivotCellBaseEventArgs.
DataField Gets the data field which identifies the column where the processed cell resides. Inherited from PivotCellBaseEventArgs.
DisplayText Gets the display text of the cell currently being processed. Inherited from PivotCellBaseEventArgs.
Element Gets the visual element that represents the processed cell.
Focused Gets whether the processed cell is the focused cell. Inherited from PivotCellBaseEventArgs.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
RowCustomTotal Gets the custom total to which the processed cell's row corresponds. Inherited from PivotCellBaseEventArgs.
RowField Gets the innermost row field which corresponds to the processed cell. Inherited from PivotCellBaseEventArgs.
RowFieldIndex This member supports the internal infrastructure and is not intended to be used directly from your code. Inherited from PivotCellBaseEventArgs.
RowIndex Gets the visual index of the row that contains the processed cell. Inherited from PivotCellBaseEventArgs.
RowValueType Gets the type of the cell's row header. Inherited from PivotCellBaseEventArgs.
Selected Gets whether the processed cell is selected. Inherited from PivotCellBaseEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.
SummaryType Gets the type of summary calculated in the current cell. Inherited from PivotCellBaseEventArgs.
SummaryValue Gets the summary value currently being processed. Inherited from PivotCellBaseEventArgs.
Value Gets the processed cell's value. Inherited from PivotCellBaseEventArgs.

Remarks

The CellDoubleClick event occurs when any cell contained within the Data Area, is double-clicked. The event parameter provides properties which allow you to identify the row and column in which the processed cell resides, the data field to which the cell corresponds, whether the cell is selected or focused, etc.

Examples

This example demonstrates how to obtain the records from the control's underlying data source for a particular cell. Double-click a cell to invoke a form that contains a grid with the underlying data.

NOTE

The complete sample project How to: Display Underlying (Drill-Down) Records is available in the DevExpress Examples repository.

This example is based on the DevExpress MVVM Framework. When a user double-clicks a cell, the EventToCommand class invokes the bound ShowDrillDownDataCommand defined in the ViewModel.

To pass the event data as a parameter to the command, the EventToCommand.PassEventArgsToCommand property is set to true. The EventArgsToCellInfoConverter instance is assigned to the EventToCommand.EventArgsConverter property to convert the event data to the CellInfo parameter type required for the command.

The command calls the DialogService.ShowDialog method to invoke a custom window that displays the underlying data. The DialogService is a part of the DevExpress MVVM Framework. It is defined in XAML and specifies the DXDialogWindow that contains the GridControl bound to the CellInfo.DrillDownDataSource property.

using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using DevExpress.Mvvm.POCO;
using DevExpress.Xpf.PivotGrid;
using HowToObtainUnderlyingData.NWindDataSetTableAdapters;
using static HowToObtainUnderlyingData.NWindDataSet;

namespace HowToObtainUnderlyingData
{
    [POCOViewModel]
    public class ViewModel {
        SalesPersonTableAdapter salesPersonDataAdapter = new SalesPersonTableAdapter();
        public SalesPersonDataTable DataSource { get; } = new SalesPersonDataTable();

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

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