Exemple #1
0
        void InitializePivot(int pivotIndex, string expression, string name)
        {
            PivotGridControl pivot = pivotGridControls[pivotIndex];

            pivot.BeginUpdate();
            pivot.Fields.Clear();
            pivot.Fields.Add(GetField("Name", "fieldName", PivotArea.RowArea));
            pivot.Fields.Add(GetField("Field1", Field1Name, PivotArea.DataArea));
            pivot.Fields.Add(GetField("Field2", Field2Name, PivotArea.DataArea));
            pivot.Fields.Add(GetField("Date", "fieldDate", PivotArea.ColumnArea));
            pivot.DataSource = GetDataView();
            pivot.OptionsData.DataFieldUnboundExpressionMode =
                DataFieldUnboundExpressionMode.UseSummaryValues;
            pivot.EndUpdate();

            if (string.IsNullOrEmpty(name))
            {
                SetCondition(pivot, expression, null);
                name = "all fields";
            }
            else
            {
                SetCondition(pivot, expression, pivot.Fields[name]);
            }
            this.labels[pivotIndex].Text = expression + "   =>  '" + name + "' cells";
        }
Exemple #2
0
 public void TearDown(object uiControl)
 {
     pivot.BeginUpdate();
     pivot.Fields["ID"].Area    = PivotArea.FilterArea;
     pivot.ActiveFilterCriteria = null;
     pivot.EndUpdate();
     pivot = null;
 }
Exemple #3
0
 public void TearDown(object uiControl)
 {
     pivot.BeginUpdate();
     pivot.Fields["Amount"].Area = PivotArea.FilterArea;
     pivot.Fields["ID"].Area     = PivotArea.FilterArea;
     pivot.Fields["Name"].Area   = PivotArea.FilterArea;
     pivot.EndUpdate();
     pivot = null;
 }
Exemple #4
0
 public void SetUp(object uiControl)
 {
     Row.EnsureListSource(ref dataSource, Configuration.Current.Rows);
     pivot = ((PivotGridControl)uiControl);
     pivot.BeginUpdate();
     pivot.DataSource = dataSource;
     pivot.RetrieveFields(PivotArea.FilterArea, true);
     pivot.Fields["ID"].Area    = PivotArea.RowArea;
     pivot.ActiveFilterCriteria = null;
     pivot.EndUpdate();
 }
Exemple #5
0
        private static void ResetTopFiveValues(PivotGridControl pivotGrid)
        {
            pivotGrid.BeginUpdate();
            var fields = pivotGrid.GetFieldsByArea(FieldArea.ColumnArea).Union(pivotGrid.GetFieldsByArea(FieldArea.RowArea));

            foreach (var f in fields)
            {
                f.SortByField = null;
                f.SortByConditions.Clear();
                f.TopValueCount      = 0;
                f.TopValueShowOthers = false;
            }
            pivotGrid.EndUpdate();
        }
        private void pivotGridControl1_FieldFilterChanged(object sender, PivotFieldEventArgs e)
        {
            PivotGridControl pivot = sender as PivotGridControl;

            pivot.BeginUpdate();
            foreach (PivotGridField field in pivot.Fields)
            {
                if (field.Visible == false || field.Area == FieldArea.DataArea || field.Area == FieldArea.FilterArea)
                {
                    continue;
                }
                CollapseAllNewValues(visibleValues[field], field.GetVisibleValues(), field);
            }
            pivot.EndUpdate();
        }
Exemple #7
0
        private void SetPivotGridData(DataTable dt, PivotGridControl pivotGrid)
        {
            XtraPivotGridHelper.DataViewTable dataTable = new XtraPivotGridHelper.DataViewTable();

            foreach (DataColumn info in dt.Columns)
            {
                dataTable.AddColumn(info.ColumnName, info.ColumnName, info.DataType, PivotArea.RowArea, null, null);
            }

            pivotGrid.BeginUpdate();
            pivotGrid.ClearPivotGridFields();
            pivotGrid.CreatePivotGridFields(dataTable);
            pivotGrid.DataSource = dt;
            pivotGrid.EndUpdate();
            if (dt.Rows.Count < 10000)
            {
                pivotGrid.BestFit();
            }
        }
Exemple #8
0
 private void BindBegin(PivotGridControl pivotGrid)
 {
     pivotGrid.BeginUpdate();
     pivotGrid.OptionsSelection.MultiSelect = true;
 }