Example #1
0
 public void ChangeCellsValuesViaHandCoding()
 {
     using (new PivotGridTestInitializer()) {
         decimal firstCellNewValue  = 2.87m;
         decimal secondCellNewValue = 3.62m;
         decimal thirdCellNewValue  = 4.12m;
         PivotUIMap.SwitchToInPlaceEditorsDemoModule();
         DXPivotGrid pivot = PivotUIMap.UIXtraPivotGridFeatureWindow2.UIPanelControl1Client.UIGcContainerClient.UIInplaceEditorsCustom.UIMainPanelClient.UIPivotGridControlPivotGrid;
         Mouse.Click(pivot.FocusedCell);
         DXTestControl activeEditor = pivot.ActiveEditor;
         activeEditor.Value = firstCellNewValue;
         pivot.FocusedCell  = pivot.GetCell(0, 1);
         Keyboard.SendKeys("{Enter}");
         activeEditor       = pivot.ActiveEditor;
         activeEditor.Value = secondCellNewValue;
         activeEditor       = pivot.GetCell(0, 2).ActiveEditor;
         activeEditor.Value = thirdCellNewValue;
         Mouse.Click(pivot.GetCell(0, 3));
         Assert.AreEqual(firstCellNewValue, Decimal.Round((decimal)pivot.GetCellValue(0, 0), 5));
         Assert.AreEqual(secondCellNewValue, Decimal.Round((decimal)pivot.GetCell(0, 1).Value, 5));
         Assert.AreEqual(thirdCellNewValue, Decimal.Round((decimal)pivot.GetCellValue(0, 2), 5));
     }
 }
Example #2
0
 public void TestOtherHandCodingCapabilities()
 {
     using (new PivotGridTestInitializer()) {
         PivotUIMap.SwitchToSingleTotalDemoModule();
         DXPivotGrid            pivot = PivotUIMap.UIXtraPivotGridFeatureWindow1.UIPanelControl1Client.UIGcContainerClient.UISingleTotalCustom.UIPivotGridControl1PivotGrid;
         DXPivotGridCell        cell  = pivot.GetCell(1, 1);
         DXPivotGridFieldValue  columnFieldValueItem = cell.ColumnFieldValueItem;
         DXPivotGridFieldValue  rowFieldValueItem    = cell.RowFieldValueItem;
         DXPivotGridFieldValue  dataFieldValueItem   = cell.DataFieldValueItem;
         DXPivotGridFieldHeader columnFieldHeader    = cell.ColumnFieldHeader;
         DXPivotGridFieldHeader rowFieldHeader       = cell.RowFieldHeader;
         DXPivotGridFieldHeader dataFieldHeader      = cell.DataFieldHeader;
         Assert.AreEqual("fieldQuarter", columnFieldValueItem.FieldName);
         Assert.AreEqual(1, columnFieldValueItem.Level);
         Assert.AreEqual(0, columnFieldValueItem.LastLevelIndex);
         Assert.AreEqual(PivotAreaType.ColumnArea, columnFieldValueItem.Area);
         Assert.AreEqual(1, columnFieldValueItem.Value);
         Assert.AreEqual("Quarter 1", columnFieldValueItem.Text);
         Assert.AreEqual("ProductName", rowFieldValueItem.FieldName);
         Assert.AreEqual(1, rowFieldValueItem.Level);
         Assert.AreEqual(1, rowFieldValueItem.LastLevelIndex);
         Assert.AreEqual(PivotAreaType.RowArea, rowFieldValueItem.Area);
         Assert.AreEqual("Chang", rowFieldValueItem.Value);
         Assert.AreEqual("Chang", rowFieldValueItem.Text);
         Assert.AreEqual("Quantity", dataFieldValueItem.FieldName);
         Assert.AreEqual(2, dataFieldValueItem.Level);
         Assert.AreEqual(1, dataFieldValueItem.LastLevelIndex);
         Assert.AreEqual(PivotAreaType.ColumnArea, dataFieldValueItem.Area);
         Assert.AreEqual(null, dataFieldValueItem.Value);
         Assert.AreEqual("Quantity (Sum)", dataFieldValueItem.Text);
         Assert.AreEqual("fieldQuarter", columnFieldHeader.FieldName);
         Assert.AreEqual(1, columnFieldHeader.AreaIndex);
         Assert.AreEqual(PivotAreaType.ColumnArea, columnFieldHeader.Area);
         Assert.AreEqual("Quarter", columnFieldHeader.Text);
         Assert.AreEqual("ProductName", rowFieldHeader.FieldName);
         Assert.AreEqual(1, rowFieldHeader.AreaIndex);
         Assert.AreEqual(PivotAreaType.RowArea, rowFieldHeader.Area);
         Assert.AreEqual("Product Name", rowFieldHeader.Text);
         Assert.AreEqual("Quantity", dataFieldHeader.FieldName);
         Assert.AreEqual(1, dataFieldHeader.AreaIndex);
         Assert.AreEqual(PivotAreaType.DataArea, dataFieldHeader.Area);
         Assert.AreEqual("Quantity (Sum)", dataFieldHeader.Text);
         dataFieldHeader.Area      = PivotAreaType.ColumnArea;
         dataFieldHeader.AreaIndex = 2;
         Assert.AreEqual(PivotAreaType.ColumnArea, dataFieldHeader.Area);
         Assert.AreEqual(2, dataFieldHeader.AreaIndex);
     }
 }