Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1060
How can I disable editing of the totals cells in an editable measure?
posted

I've followed the instructions here - https://es.infragistics.com/help/wpf/xampivotgrid-editingdatacells to make one of the measures in my pivot grid editable.

Unfortunately, the Totals cell for the measure is also editable.

I've put this code at the top of the CellEditing and CellEdited event handlers respectively to prevent the edit being accepted:

if (e.Cell.DataColumn.IsTotal || e.Cell.DataRow.IsTotal)
{
    e.Cancel = true;
}

if (e.Cell.DataColumn.IsTotal || e.Cell.DataRow.IsTotal)
{
    return;
}

but the cell still enters edit mode:

Is there any way I can prevent this?

Parents
  • 34810
    Verified Answer
    Offline posted

    Hello Kevin,

    I have been investigating into the behavior you are looking to achieve, and in order to prevent a Totals column or row from going into edit mode, I would recommend that you utilize the CellEnterEdit event of the XamPivotGrid and hook it into the following handler, where "grid" is the XamPivotGrid:

            private void grid_CellEnterEdit(object sender, Infragistics.Controls.Grids.PivotCellEnterEditEventArgs e)
            {
                if (e.Cell.DataRow.IsTotal || e.Cell.DataColumn.IsTotal)
                {
                    Dispatcher.BeginInvoke(new Action(() =>
                    {
                        grid.MoveEditCell(null, false);
                    }));
                }
            }

    Please let me know if you have any other questions or concerns on this matter.

Reply Children
No Data