Skip to main content

EventArgsToCellInfoConverter Class

A converter used to convert the event argument to the CellInfo class.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public class EventArgsToCellInfoConverter :
    EventArgsConverterBase<EventArgs>

Remarks

A project that uses the DevExpress MVVM Framework and implements the EventToCommand behavior may need a converter to translate event data to command parameters. Assign the EventArgsToCellInfoConverter object to the EventToCommand.EventArgsConverter property if your command accepts the CellInfo parameter type.

Example

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);
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EventArgsToCellInfoConverter class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
MarkupExtension
DevExpress.Mvvm.UI.EventArgsConverterBase<EventArgs>
EventArgsToCellInfoConverter
See Also