Category / Section
How to make the Pivot Grid Properly reflect to row
1 min read
It can be achieved by using RaisePivotSchemaChangedEvent instead of calling Refresh method. The following code explains the same.
C#
this.pivotGrid1.DeferLayoutUpdate = true; this.pivotGrid1.PivotRows.Clear(); for (var i = 0; i < vm.Rows.Count; i++) { this.pivotGrid1.PivotEngine.InsertRowPivot(i, vm.Rows[i]); } this.pivotGrid1.PivotColumns.Clear(); for (var i = 0; i < vm.Columns.Count; i++) { this.pivotGrid1.PivotEngine.InsertColumnPivot(i, vm.Columns[i]); } this.pivotGrid1.PivotCalculations.Clear(); for (var i = 0; i < vm.Computations.Count; i++) { this.pivotGrid1.PivotEngine.InsertPivotCalculation(i, vm.Computations[i]); } //this.pivotGrid1.Refresh(); this.pivotGrid1.DeferLayoutUpdate = false; this.pivotGrid1.PivotEngine.RaisePivotSchemaChangedEvent(new PivotSchemaChangedArgs());