0

I am using Dev ex pivot grid to show some data on the screen. When user click on any cell in data area, I want to find out it's corresponding row, column and data area value and their field name.

I am handling CellClick event of devex pivot grid. with PivotCellEventArgs object I can find fieldname but not value.

I want the name and value for given cell from all perspectives (row, column and data area).

Thanks in advance.

Abhash786
  • 881
  • 2
  • 24
  • 53

1 Answers1

0

In Razor MVC you can do that

@Html.DevExpress().PivotGrid(settings =>
{
    settings.Name = "PivotGrid";
    settings.CallbackRouteValues = new { Controller = "Home", Action = "PivotGridPartial" };

    settings.ClientSideEvents.CellClick = @"
    function(s,e){
        var EventArgs=e; 
        console.log(EventArgs.RowValue);
        console.log(EventArgs.RowFieldName);
        console.log(EventArgs.ColumnValue);
        console.log(EventArgs.ColumnFieldName);
        console.log(EventArgs.Value); 
    }";

    settings.Fields.Add(field =>
    {
        field.Area = PivotArea.RowArea;
        ...
    });

    settings.Fields.Add(field =>
    {
        field.Area = PivotArea.ColumnArea;
        ...
    });

    settings.Fields.Add(field =>
    {
        field.Area = PivotArea.DataArea;
        ...
    });

}).Bind(Model).GetHtml()