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?
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.
I'd determined that I needed to implement the CellEnterEdit handler but I couldn't work out how to use it to cancel the edit.
Thanks.