public void ChangeGridBandsOrderTest() { using (new GridsTestInitializer()) { DXTestControl accordionControlItem = new UIgridDemoWindow().UIGridNavigationClient.UIAccordionControl.UIAccordionControlGroupGridViews.UIAccordionControlItemBandedViews; Mouse.Click(accordionControlItem, new Point(1, 1)); DXCheckButton bandedViewCheckButton = new UIgridDemoWindow().UIGridPanelControl.UICheckButton; bandedViewCheckButton.Checked = true; DXGrid grid = new UIgridDemoWindow().UIGridPanelControl.UIGridContainerClient.UIGridViewStyleCustom.UIGrid; DXGridBand bandParent = new DXGridBand(grid, grid.Views[0].Name, "gridBand1"); DXGridBand bandChild1 = new DXGridBand(grid, grid.Views[0].Name, "gridBand2"); DXGridBand bandChild2 = new DXGridBand(grid, grid.Views[0].Name, "gridBand3"); int oldBandChild1Position = bandChild1.VisibleIndex; int oldBandChild2Position = bandChild2.VisibleIndex; bandChild1.SetBandPosition(bandParent.BandName, bandChild2.VisibleIndex); Assert.IsTrue(bandChild1.VisibleIndex == oldBandChild2Position && bandChild2.VisibleIndex == oldBandChild1Position); oldBandChild1Position = bandChild1.VisibleIndex; oldBandChild2Position = bandChild2.VisibleIndex; bandChild1.SetBandPosition(bandParent, bandChild2.VisibleIndex); Assert.IsTrue(bandChild1.VisibleIndex == oldBandChild2Position && bandChild2.VisibleIndex == oldBandChild1Position); oldBandChild1Position = bandChild1.VisibleIndex; oldBandChild2Position = bandChild2.VisibleIndex; bandChild1.SetBandPosition(bandChild2.VisibleIndex); Assert.IsTrue(bandChild1.VisibleIndex == oldBandChild2Position && bandChild2.VisibleIndex == oldBandChild1Position); } }
public void CheckGridBandParentTest() { using (new GridsTestInitializer()) { DXTestControl accordionControlItem = new UIgridDemoWindow().UIGridNavigationClient.UIAccordionControl.UIAccordionControlGroupGridViews.UIAccordionControlItemBandedViews; Mouse.Click(accordionControlItem, new Point(1, 1)); DXCheckButton bandedViewCheckButton = new UIgridDemoWindow().UIGridPanelControl.UICheckButton; bandedViewCheckButton.Checked = true; DXGrid grid = new UIgridDemoWindow().UIGridPanelControl.UIGridContainerClient.UIGridViewStyleCustom.UIGrid; DXGridBand bandParent = new DXGridBand(grid, grid.Views[0].Name, "gridBand1"); DXGridBand bandChild = new DXGridBand(grid, grid.Views[0].Name, "gridBand2"); Assert.IsTrue(bandChild.ParentBandName == bandParent.BandName); } }
public void ChangeGridBandWidthTest() { using (new GridsTestInitializer()) { DXTestControl accordionControlItem = new UIgridDemoWindow().UIGridNavigationClient.UIAccordionControl.UIAccordionControlGroupGridViews.UIAccordionControlItemBandedViews; Mouse.Click(accordionControlItem, new Point(1, 1)); DXCheckButton bandedViewCheckButton = new UIgridDemoWindow().UIGridPanelControl.UICheckButton; bandedViewCheckButton.Checked = true; DXGrid grid = new UIgridDemoWindow().UIGridPanelControl.UIGridContainerClient.UIGridViewStyleCustom.UIGrid; DXGridBand bandParent = new DXGridBand(grid, grid.Views[0].Name, "gridBand1"); DXGridBand bandChild = new DXGridBand(grid, grid.Views[0].Name, "gridBand2"); int oldWidthBandParent = bandParent.Width; int oldWidthBandChild = bandChild.Width; bandParent.Width = oldWidthBandParent + 100; bandChild.Width = oldWidthBandChild + 100; int newWidthBandParent = bandParent.Width; int newWidthBandChild = bandChild.Width; Assert.IsTrue(newWidthBandParent > oldWidthBandParent && newWidthBandChild > oldWidthBandChild); } }
public void ChangeFocusedCellTest() { using (new GridsTestInitializer()) { DXTestControl accordionControlItem = new UIgridDemoWindow().UIGridNavigationClient.UIAccordionControl.UIAccordionControlGroupLayoutFeatures.UIAccordionControlItemCellSelectionView; Mouse.Click(accordionControlItem, new Point(1, 1)); DXGrid grid = new UIgridDemoWindow().UIGridPanelControl.UIGridContainerClient.UIGridCellSelectionCustom.UIGrid; grid.WindowTitles.Add("The XtraGrid Suite by DevExpress (C# code) - Cell Selection"); DXRow gridRow = grid.Views[0].GetRow(2); DXCell firstFocusedCell = gridRow.GetCell("colCity"); grid.Views[0].FocusedCell = firstFocusedCell; Assert.AreEqual(firstFocusedCell.Text, grid.Views[0].FocusedCell.Text); DXCell secondFocusedCell = gridRow.VisibleCells[0]; grid.Views[0].FocusedCell = secondFocusedCell; Assert.AreEqual(secondFocusedCell.Text, grid.Views[0].FocusedCell.Text); DXCell thirdFocusedCell = new DXCell(grid, gridRow.ViewName, "colAddress", gridRow.RowHandle); grid.Views[0].FocusedCell = thirdFocusedCell; Assert.AreEqual(thirdFocusedCell.Text, grid.Views[0].FocusedCell.Text); } }