Example #1
0
 private object GetPivotFieldValue(ASPxPivotGrid pivotGridControl, PivotGridField field, int columnIndex, int rowIndex)
 {
     if (field == null || pivotGridControl == null)
     {
         return(null);
     }
     if (field.Area == PivotArea.ColumnArea)
     {
         return(pivotGridControl.GetFieldValue(field, columnIndex));
     }
     else if (field.Area == PivotArea.RowArea)
     {
         return(pivotGridControl.GetFieldValue(field, rowIndex));
     }
     else if (field.Area == PivotArea.FilterArea)
     {
         if (field.FilterValues.ValuesIncluded.Length == 1)
         {
             return(field.FilterValues.ValuesIncluded[0]);
         }
     }
     return(null);
 }
Example #2
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);
         }
     }
 }