Beispiel #1
0
 void GetFieldsAndValues(ASPxPivotGrid pivotGrid, int fieldIndex, int visibleIndex, int dataIndex, PivotArea area, out PivotGridField dataField, out List <PivotGridField> fields, out List <object> values)
 {
     fields    = new List <PivotGridField>();
     values    = new List <object>();
     dataField = pivotGrid.GetFieldByArea(PivotArea.DataArea, dataIndex);
     if (fieldIndex >= 0)
     {
         var clickedField = pivotGrid.Fields[fieldIndex];
         for (int i = 0; i <= clickedField.AreaIndex; i++)
         {
             var field = pivotGrid.GetFieldByArea(area, i);
             fields.Add(field);
             object value = pivotGrid.GetFieldValue(field, visibleIndex);
             values.Add(value);
         }
     }
 }
Beispiel #2
0
 private bool ShouldDisplaySecondValue(PivotGridCellTemplateItem cell)
 {
     if (cell.RowValueType == DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal)
     {
         PivotGridField rowField = pivotGrid.GetFieldByArea(DevExpress.XtraPivotGrid.PivotArea.RowArea, 0);
         if (rowField != null && rowField.TopValueCount > 0)
         {
             return(true);
         }
     }
     if (cell.ColumnValueType == DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal)
     {
         PivotGridField columnField = pivotGrid.GetFieldByArea(DevExpress.XtraPivotGrid.PivotArea.ColumnArea, 0);
         if (columnField != null && columnField.TopValueCount > 0)
         {
             return(true);
         }
     }
     return(false);
 }