void SyncPivots(ASPxPivotGrid source, ASPxPivotGrid visiblePivot) { source.BeginUpdate(); foreach (PivotGridField visibleField in visiblePivot.Fields) { PivotGridField sourceField = (PivotGridField)source.Fields.GetFieldByName(visibleField.ID + "_Source"); SyncFields(sourceField, visibleField); } source.EndUpdate(); source.ExpandAll(); }
void SetSortByColumn(ASPxPivotGrid pivotGrid, PivotArea crossArea, PivotGridField dataField, List <PivotGridField> fields, List <object> values) { pivotGrid.BeginUpdate(); List <PivotGridField> crossFields = pivotGrid.GetFieldsByArea(crossArea); for (int i = 0; i < crossFields.Count; i++) { crossFields[i].SortBySummaryInfo.Field = dataField; crossFields[i].SortBySummaryInfo.Conditions.Clear(); for (int j = 0; j < values.Count; j++) { crossFields[i].SortBySummaryInfo.Conditions.Add( new PivotGridFieldSortCondition(fields[j], values[j])); } } pivotGrid.EndUpdate(); }