protected void ASPxPivotGrid1_CustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
        {
            ASPxPivotGrid pivot = (ASPxPivotGrid)sender;

            pivot.JSProperties["cpAlertMessage"] = null;
            string[] parameters = e.Parameters.Split(new char[] { '|' });
            if (parameters.Length == 5 && parameters[0] == "MenuItemClick")
            {
                if (parameters[1] == "hideValue")
                {
                    bool isColumn = parameters[4] == "ColumnArea";
                    PivotFieldValueEventArgs fieldValueInfo = pivot.GetFieldValueInfo(isColumn, Convert.ToInt32(parameters[3]));
                    if (isColumn)
                    {
                        pivot.JSProperties["cpAlertMessage"] = string.Format("Cannot hide the {0} column", fieldValueInfo.Value);
                    }
                    else
                    {
                        if (fieldValueInfo.Field != null)
                        {
                            fieldValueInfo.Field.FilterValues.Add(fieldValueInfo.Value);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 protected void ASPxPivotGrid1_CustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
 {
     string[] args = e.Parameters.Split('|');
     if (args[0] == "SC")
     {
         HandleSortByColumnClick((ASPxPivotGrid)sender, args);
     }
 }
Beispiel #3
0
        void PivotGrid_CustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
        {
            string[] parameters       = e.Parameters.Split(",".ToCharArray());
            var      field            = PivotGrid.Fields.GetFieldByName(parameters[0]);
            var      selectedValueStr = parameters.Skip(1).OrderBy(v => v).ToArray();

            object[] uniqueValues   = field.GetUniqueValues();
            object[] valuesExcluded = uniqueValues.Where(v => !ContainItem(selectedValueStr, Convert.ToString(v))).ToArray();
            field.FilterValues.ValuesExcluded = valuesExcluded;
        }
 void PivotGridControlOnCustomCallback(object sender, PivotGridCustomCallbackEventArgs pivotGridCustomCallbackEventArgs) {
     var args = pivotGridCustomCallbackEventArgs.Parameters.Split('|');
     var columnIndex = Convert.ToInt32(args[0]);
     var rowIndex = Convert.ToInt32(args[1]);
     var value = Convert.ToDouble(args[2]);
     var asPxPivotGrid = ((ASPxPivotGrid)sender);
     var pivotDrillDownDataSource = asPxPivotGrid.CreateDrillDownDataSource(columnIndex, rowIndex);
     for (int i = 0; i < pivotDrillDownDataSource.RowCount; i++) {
         pivotDrillDownDataSource[i]["Amount"] = Convert.ToDouble(value);
     }
 }
Beispiel #5
0
        void PivotGridControlOnCustomCallback(object sender, PivotGridCustomCallbackEventArgs pivotGridCustomCallbackEventArgs)
        {
            var args                     = pivotGridCustomCallbackEventArgs.Parameters.Split('|');
            var columnIndex              = Convert.ToInt32(args[0]);
            var rowIndex                 = Convert.ToInt32(args[1]);
            var value                    = Convert.ToDouble(args[2]);
            var asPxPivotGrid            = ((ASPxPivotGrid)sender);
            var pivotDrillDownDataSource = asPxPivotGrid.CreateDrillDownDataSource(columnIndex, rowIndex);

            for (int i = 0; i < pivotDrillDownDataSource.RowCount; i++)
            {
                pivotDrillDownDataSource[i]["Amount"] = Convert.ToDouble(value);
            }
        }
Beispiel #6
0
        protected void OnPivotCustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
        {
            ASPxPivotGrid pivot = (ASPxPivotGrid)sender;

            string[] args     = e.Parameters.Split('|');
            int      colIndex = int.Parse(args[1]);
            int      rowIndex = int.Parse(args[2]);

            ChangeCellValue(
                pivot.CreateDrillDownDataSource(colIndex, rowIndex),
                (decimal)pivot.GetCellValue(colIndex, rowIndex),
                decimal.Parse(args[3], NumberStyles.Currency)
                );
        }
Beispiel #7
0
    protected void ASPxPivotGrid1_CustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
    {
        if (String.IsNullOrEmpty(e.Parameters))
        {
            return;
        }

        String[] args = e.Parameters.Split('|');
        if (args[0] == "MenuItemClick")
        {
            switch (args[1])
            {
            case "Filter":
                PivotGridField field       = ASPxPivotGrid1.Fields[args[2]];
                int            itemIndex   = Int32.Parse(args[3]);
                Object         filterValue = ASPxPivotGrid1.GetFieldValueByIndex(field, itemIndex);
                field.FilterValues.ValuesIncluded = new Object[] { filterValue };
                break;
            }
        }
    }
Beispiel #8
0
 protected void OnASPxPivotGridCustomCallback(object sender, PivotGridCustomCallbackEventArgs e)
 {
     string[] args = e.Parameters.Split('|');
     if ("SL" == args[0])
     {
         if (null == Session["SelectedValue"])
         {
             Session.Add("SelectedValue", args[1]);
         }
         else
         {
             Session["SelectedValue"] = args[1];
         }
         if (null == Session["SelectedArea"])
         {
             Session.Add("SelectedArea", Enum.Parse(typeof(PivotArea), args[2]));
         }
         else
         {
             Session["SelectedArea"] = Enum.Parse(typeof(PivotArea), args[2]);
         }
     }
 }