Beispiel #1
0
 private void Grid_CellMouseUp(object sender, GridCellMouseControllerEventArgs args)
 {
     if (grid.CurrentCell.ColumnIndex == 0)
     {
         grid.InvalidateRenderCell(GridRangeInfo.Table());
     }
 }
Beispiel #2
0
        /// <summary>
        /// GridGrouping control getting started customization.
        /// </summary>
        private void GridSettings()
        {
            //used to set multiextended selection mode in gridgrouping control.
            this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;

            this.gridGroupingControl1.TableOptions.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
            this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
            StringCollection ar = new StringCollection();

            ar.Add("Left Align");
            ar.Add("Center Align");
            ar.Add("Right Align");
            comboBoxAdv1.DataSource = ar;

            //used to set GridCaptionRowHeight.
            this.gridGroupingControl1.TableControl.DpiAware              = true;
            this.gridGroupingControl1.Table.DefaultCaptionRowHeight      = (int)DpiAware.LogicalToDeviceUnits(25.0f);;
            this.gridGroupingControl1.Table.DefaultColumnHeaderRowHeight = (int)DpiAware.LogicalToDeviceUnits(30.0f);;
            this.gridGroupingControl1.Table.DefaultRecordRowHeight       = (int)DpiAware.LogicalToDeviceUnits(22.0f);;
            this.gridGroupingControl1.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Table());

            //Navigate to other control using tabkey navigation
            this.gridGroupingControl1.WantTabKey = false;
        }
Beispiel #3
0
        //		protected override void OnClick(int rowIndex, int colIndex, System.Windows.Forms.MouseEventArgs e)
        //		{
        //		//if you call ClickTreeNode here instead of OnMouseDown,
        //		//then the action is done later after the mouseup...
        //		//	ClickTreeNode(rowIndex, colIndex, e);
        //			base.OnClick(rowIndex, colIndex, e);
        //			return;
        //		}


        private void ClickTreeNode(int rowIndex, int colIndex, System.Windows.Forms.MouseEventArgs e)
        {
            Rectangle rect = GetCellBoundsCore(rowIndex, colIndex);
            int       X    = rect.X + IndentSize * (int)this.Grid.Model[rowIndex, colIndex].Tag;

            rect.X      = X;
            rect.Width  = this.bitmapWidth;
            rect.Height = this.bitmapHeight;

            if (rect.Contains(new Point(e.X, e.Y)))
            {
                if (this.Grid.Model[rowIndex, colIndex].ImageIndex == (int)TreeNodeState.Opened)
                {
                    this.Grid.Model[rowIndex, colIndex].ImageIndex = (int)TreeNodeState.Closed;
                }
                else if (this.Grid.Model[rowIndex, colIndex].ImageIndex == (int)TreeNodeState.Closed)
                {
                    this.Grid.Model[rowIndex, colIndex].ImageIndex = (int)TreeNodeState.Opened;
                    if (!nodeList.Contains(this.Grid.Model[rowIndex, 3].Text))
                    {
                        OnExpandRow(rowIndex);
                    }
                }
            }

            this.Grid.Refresh();
            this.Grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());
        }
Beispiel #4
0
        private void InitializePatternBoard(ref GridControl grd_control)
        {
            grd_control.Model.RowCount      = 30;
            grd_control.Model.ColumnCount   = 100;
            grd_control.Model.HeaderRows    = 1;
            grd_control.Model.HeaderColumns = 1;
            grd_control.IsEnabled           = false;

            // 셀 스타일 설정
            for (int i = 0; i < 30; i++)
            {
                for (int j = 0; j < 100; j++)
                {
                    grd_control.Model[i, j].Font.FontSize       = 20;
                    grd_control.Model[i, j].VerticalAlignment   = VerticalAlignment.Center;
                    grd_control.Model[i, j].HorizontalAlignment = HorizontalAlignment.Center;
                }
            }

            // 해더 셋팅
            for (int i = 1; i <= 100; i++)
            {
                grd_control.Model[0, i].CellValue = $"{i}";
            }

            for (int i = 1; i <= 30; i++)
            {
                grd_control.Model[i, 0].CellValue = $"{i}";
            }

            grd_control.Model.ResizeRowsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);
            grd_control.Model.ResizeColumnsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);
        }
Beispiel #5
0
        /// <summary>
        /// Initialize the properties for the grid
        /// </summary>
        void InitializeGrid()
        {
            //Load Data
            string xmlName = GetFile("Orders.xml");

            DataSet orderDataSet = new DataSet();

            if (this.ReadXml(orderDataSet, xmlName))
            {
                DataTable orderTable = orderDataSet.Tables[0];
                this.gridControl1.RowCount = 100;
                this.gridControl1.ColCount = orderTable.Columns.Count - 1;

                this.gridControl1.PopulateValues(GridRangeInfo.Cells(1, 1, this.gridControl1.RowCount, this.gridControl1.ColCount), orderDataSet.Tables[0]);
                this.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, this.gridControl1.ColCount), orderTable);
            }

            for (int col = 4; col < 7; col++)
            {
                this.gridControl1.ColStyles[col].CellType      = "MonthCalendar";
                this.gridControl1.ColStyles[col].ShowButtons   = GridShowButtons.Hide;
                this.gridControl1.ColStyles[col].CellValueType = typeof(DateTime);
                this.gridControl1.ColStyles[col].Format        = "MM/dd/yyyy";
            }

            //Set grid appearance
            this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table());
            this.gridControl1.GridVisualStyles       = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            this.gridControl1.ThemesEnabled          = true;
            this.gridControl1.DefaultGridBorderStyle = GridBorderStyle.Solid;
        }
Beispiel #6
0
        private void InitializeBeadPlateBoard()
        {
            _grd_bead_plate.Model.RowCount      = 7;
            _grd_bead_plate.Model.ColumnCount   = 80;
            _grd_bead_plate.Model.HeaderRows    = 1;
            _grd_bead_plate.Model.HeaderColumns = 1;

            // 셀 스타일 설정
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 80; j++)
                {
                    _grd_bead_plate.Model[i, j].Font.FontSize       = 20;
                    _grd_bead_plate.Model[i, j].VerticalAlignment   = VerticalAlignment.Center;
                    _grd_bead_plate.Model[i, j].HorizontalAlignment = HorizontalAlignment.Center;
                }
            }

            // 해더 셋팅
            for (int i = 1; i <= 80; i++)
            {
                _grd_bead_plate.Model[0, i].CellValue = $"{i}";
            }

            for (int i = 1; i <= 7; i++)
            {
                _grd_bead_plate.Model[i, 0].CellValue = $"{i}";
            }

            _grd_bead_plate.Model.ResizeRowsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);
            _grd_bead_plate.Model.ResizeColumnsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);
        }
Beispiel #7
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog
            {
                DefaultExt       = ".pdf",
                Filter           = "Adobe PDF Files(*.pdf)|*.pdf",
                FilterIndex      = 1,
                RestoreDirectory = true
            };
            PdfDocument document;

            if (sfd.ShowDialog() == true)
            {
                using (Stream stream = sfd.OpenFile())
                {
                    DrawingHeaderFooter();
                    document = this.grid.Model.ExportToPdfGridDocument(GridRangeInfo.Table());
                    document.Save(stream);
                    stream.Close();
                    ProcessStartInfo info = new ProcessStartInfo(sfd.FileName);
                    info.UseShellExecute = true;
                    Process.Start(info);
                    //Process.Start(sfd.FileName);
                }
            }
        }
Beispiel #8
0
 private void chkEnable_CheckStateChanged(object sender, EventArgs e)
 {
     allowTooltip         = chkEnable.Checked;
     chkColHeader.Checked = chkRowHeader.Checked = chkSumHeader.Checked = chkValue.Checked = chkSummary.Checked = allowTooltip;
     chkColHeader.Enabled = chkRowHeader.Enabled = chkSumHeader.Enabled = chkValue.Enabled = chkSummary.Enabled = allowTooltip;
     pivotGridControl1.Refresh();
     pivotGridControl1.TableControl.RefreshRange(GridRangeInfo.Table());
 }
Beispiel #9
0
		public override void InvokeAction(object sender, EventArgs e)
		{
            GridControlBase grid = ActiveGrid;
            if (grid != null)
            {
                grid.Selections.Clear();
                grid.Selections.Add(GridRangeInfo.Table());
            }
		}
Beispiel #10
0
        private void GridSetting()
        {
            GridConditionalFormatDescriptor format1 = new GridConditionalFormatDescriptor();

            format1.Appearance.AnyRecordFieldCell.TextColor = Color.Black;
            format1.Appearance.AnyRecordFieldCell.Interior  = new BrushInfo(Color.LightPink);

            format1.Expression = "[DOS1_5]=''   OR [DOS1_5]='0'" +
                                 "OR [DOS1_5]=''   OR [DOS1_5]='0'" +
                                 "OR [DOS6_10]=''  OR [DOS6_10]='0'" +
                                 "OR [DOS11_15]='' OR [DOS11_15]='0'" +
                                 "OR [DOS16_20]='' OR [DOS16_20]='0'" +
                                 "OR [DOS21_25]='' OR [DOS21_25]='0'" +
                                 "OR [DOS26_31]='' OR [DOS26_31]='0'";
            DG2.TableDescriptor.ConditionalFormats.Add(format1);


            DG2.ThemesEnabled = false;
            DG2.Appearance.ColumnHeaderCell.Themed    = false;
            DG2.Appearance.ColumnHeaderCell.Interior  = new BrushInfo(GradientStyle.Vertical, Color.LightSkyBlue, Color.White);
            DG2.Appearance.ColumnHeaderCell.TextColor = Color.Black;
            DG2.TableDescriptor.VisibleColumns.Remove("VendorID");

            DG2.TableDescriptor.Appearance.AnyCell.TextColor       = Color.Black;
            DG2.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Arial", 10f, FontStyle.Regular));
            DG2.TableDescriptor.Columns["Product_Name"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left;
            DG2.TableDescriptor.Columns["Product_Name"].Appearance.AnyRecordFieldCell.WrapText            = true;
            DG2.TableDescriptor.Columns["Product_Name"].Width = 365;

            DG2.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
            DG2.TopLevelGroupOptions.ShowCaption = false;
            DG2.AllowProportionalColumnSizing    = false;
            DG2.TableDescriptor.Columns["DOS1_5"].Appearance.AnyRecordFieldCell.CellType   = GridCellTypeName.ComboBox;
            DG2.TableDescriptor.Columns["DOS6_10"].Appearance.AnyRecordFieldCell.CellType  = GridCellTypeName.OriginalTextBox;
            DG2.TableDescriptor.Columns["DOS11_15"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.FormulaCell;
            DG2.TableDescriptor.Columns["DOS16_20"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.TextBox;

            DG2.TableDescriptor.Columns["DOS1_5"].Appearance.AnyCell.ReadOnly   = false;
            DG2.TableDescriptor.Columns["DOS6_10"].Appearance.AnyCell.ReadOnly  = false;
            DG2.TableDescriptor.Columns["DOS11_15"].Appearance.AnyCell.ReadOnly = false;
            DG2.TableDescriptor.Columns["DOS16_20"].Appearance.AnyCell.ReadOnly = false;
            DG2.TableDescriptor.Columns["DOS21_25"].Appearance.AnyCell.ReadOnly = false;
            DG2.TableDescriptor.Columns["DOS26_31"].Appearance.AnyCell.ReadOnly = false;


            GridMetroColors colors = new GridMetroColors();

            colors.PushButtonColor.NormalBackColor = Color.FromArgb(22, 165, 220);
            colors.PushButtonColor.HoverBackColor  = Color.FromArgb(26, 198, 255);
            colors.PushButtonColor.PushedBackColor = Color.FromArgb(120, 191, 217);
            this.DG2.SetMetroStyle(colors);

            DG2.TableDescriptor.AllowNew = false;
            DG2.Refresh();
            DG2.Invalidate();
            DG2.TableControl.RefreshRange(GridRangeInfo.Table());
        }
Beispiel #11
0
        void InitializeForm()
        {
            gridControl1.BeginUpdate();
            gridControl1.ThemesEnabled        = true;
            gridControl1.TableStyle.FloatCell = true;
            gridControl1.FloatCellsMode       = GridFloatCellsMode.OnDemandCalculation;
            gridControl1.AllowSelection       = GridSelectionFlags.Any;
            //Register Custom Cell Types
            this.gridControl1.CellModels.Add("Slider", new CustomControlCellModel(this.gridControl1.Model));
            this.gridControl1.CellModels.Add("DataEntry", new CustomControlCellModel(gridControl1.Model));
            this.gridControl1.CellModels.Add("ChoiceList", new CustomControlCellModel(gridControl1.Model));

            Control       control;
            GridStyleInfo style;

            //Setup DataEntry Cell
            style          = gridControl1[2, 2];
            style.CellType = "DataEntry";
            control        = new DataEntryControl();
            MakeUnBuffered(control);
            //Pass the type of CellControl to cell model class through its Tag
            style.Tag = control;

            //Setup ChoiceList Cell
            style          = gridControl1[3, 3];
            style.CellType = "ChoiceList";
            control        = new ChoiceListControl();
            MakeUnBuffered(control);
            //Pass the type of CellControl to cell model class through its Tag
            style.Tag = control;

            //Setup Slider Cell
            style          = gridControl1[4, 4];
            style.CellType = "Slider";
            //Pass the type of CellControl to cell model class through its Tag
            style.Tag = new TrackBar();

            colsize = gridControl1.ColWidths[2];
            rowsize = gridControl1.RowHeights[2];

            //Call ResizeToFit which in turn calls OnQueryPreferredClientSize method in the cell model class
            //in order to retrieve the Correct size of the controls in grid cells and adjust respective
            //RowHeights & ColWidths in order to make the cells to fit controls.
            this.gridControl1.RowHeights[0] = 30;
            gridControl1.RowHeights.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.NoShrinkSize);
            gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table());

            this.gridControl1.CellClick += new GridCellClickEventHandler(gridControl1_CellClick);
            gridControl1.EndUpdate(true);
            Application.Idle += new EventHandler(Application_Idle);
            for (int i = 1; i <= 4; i++)
            {
                widths.Add(i, gridControl1.ColWidths[i]);
            }
        }
Beispiel #12
0
 //Replace
 private void btnReplace_Click(object sender, EventArgs e)
 {
     if (cmbSearch.Text != "" && cmbReplace.Text != "")
     {
         AddToSearchedList(cmbSearch.Text);
         SetOptions();
         locInfo  = GridRangeInfo.Table();
         frEvents = new GridFindReplaceEventArgs(cmbSearch.Text, cmbReplace.Text, options, locInfo);
         frDialog.Replace(frEvents);
     }
 }
Beispiel #13
0
        /// <summary>
        /// Zooming support customization.
        /// </summary>
        private void SampleCustomization()
        {
            //Wiring the grid to ZoomGrid.
            zoom = new ZoomGrid(this.gridControl1);
            //Enabling the Zooming functionality for cell level.
            ZoomGrid.ZoomGridControlCell = true;

            this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table());

            //tab key navigation set as false to move the next control
            this.gridControl1.WantTabKey = false;
        }
Beispiel #14
0
 public Form1()
 {
     InitializeComponent();
     this.gridControl1.DpiAware = true;
     if (DpiAware.GetCurrentDpi() > 96)
     {
         this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight);
     }
     InitializeGrid();
     this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table(), GridResizeToFitOptions.IncludeCellsWithinCoveredRange);
     this.gridControl1.ColWidths[0] = (int)DpiAware.LogicalToDeviceUnits(25);
 }
 private void findnextBtn_Click(object sender, EventArgs e)
 {
     if (txtSearch.Text != "")
     {
         SetOptions();
         locInfo  = GridRangeInfo.Table();
         frEvents = new GridFindReplaceEventArgs(txtSearch.Text, "", options, locInfo);
         if (frDialog.Find(frEvents) == null)
         {
             MessageBox.Show("No Matches found for Text" + txtSearch.Text);
         }
     }
 }
Beispiel #16
0
        private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
        {
            if (e.Reason == GridSelectionReason.MouseDown)
            {
                grid.Tag = e.Range;
                if (e.Range.Top != 0)
                {
                    var       currentCell = this.grid.CurrentCell;
                    UIElement element;

                    if (currentCell.RowIndex != e.Range.Top)
                    {
                        element = this.GetInnerElement(currentCell.RowIndex, 1);
                        var userControl = element as UserControl1;
                        if (userControl != null)
                        {
                            userControl.child.Model.SelectedRanges.Clear();
                            userControl.child.InvalidateCells();
                        }
                    }
                    element = this.GetInnerElement(e.Range.Top, 1);
                    if (element != null)
                    {
                        var innerElement = element as UserControl1;
                        if (innerElement != null)
                        {
                            innerElement.child.Model.SelectedRanges.Clear();
                            innerElement.child.Model.SelectedRanges.Add(GridRangeInfo.Table());
                            innerElement.child.InvalidateCells();
                        }
                    }
                }
            }
            else if (e.Reason == GridSelectionReason.Clear)
            {
                this.grid.Tag = null;
                var style   = this.grid.Model[this.grid.CurrentCell.RowIndex, 1];
                var element = this.GetInnerElement(this.grid.CurrentCell.RowIndex, 1);
                if (element != null)
                {
                    var innerElement = element as UserControl1;
                    if (innerElement != null)
                    {
                        innerElement.child.Model.SelectedRanges.Clear();
                        innerElement.child.InvalidateCells();
                    }
                }
            }
        }
Beispiel #17
0
        //FindNext
        private void btnFindNext_Click(object sender, EventArgs e)
        {
            gridControl1.Selections.Clear();

            if (cmbSearch.Text != "")
            {
                AddToSearchedList(cmbSearch.Text);

                SetOptions();
                locInfo = GridRangeInfo.Table();
                clearHighlight();
                frEvents = new GridFindReplaceEventArgs(cmbSearch.Text, "", options, locInfo);
                frDialog.Find(frEvents);
            }
            this.gridControl1.Refresh();
        }
Beispiel #18
0
 //ReplaceAll
 private void btnReplaceAll_Click(object sender, EventArgs e)
 {
     if (cmbSearch.Text != "" && cmbReplace.Text != "")
     {
         AddToSearchedList(cmbSearch.Text);
         SetOptions();
         locInfo  = GridRangeInfo.Table();
         frEvents = new GridFindReplaceEventArgs(cmbSearch.Text, cmbReplace.Text, options, locInfo);
         frDialog.ReplaceAll(frEvents);
         clearHighlight();
     }
     else
     {
         MessageBox.Show("Search/Replace value is missing");
     }
 }
Beispiel #19
0
        /// <summary>
        /// GridGrouping control getting started customization.
        /// </summary>
        private void GridSettings()
        {
            //used to set multiextended selection mode in gridgrouping control.
            this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
            this.gridGroupingControl1.TableOptions.GridVisualStyles     = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
            this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;

            //used to set GridCaptionRowHeight.
            this.gridGroupingControl1.Table.DefaultCaptionRowHeight      = 25;
            this.gridGroupingControl1.Table.DefaultColumnHeaderRowHeight = 30;
            this.gridGroupingControl1.Table.DefaultRecordRowHeight       = 22;
            this.gridGroupingControl1.TableModel.ColWidths.ResizeToFit(GridRangeInfo.Table());

            //Navigate to other control using tabkey navigation
            this.gridGroupingControl1.WantTabKey = false;
        }
Beispiel #20
0
        //FindAll - Loops through the cells in the grid and highlights all the values
        //that match with the given search string.
        private void btnFindAll_Click(object sender, EventArgs e)
        {
            if (cmbSearch.Text != null)
            {
                AddToSearchedList(cmbSearch.Text);

                SetOptions();
                locInfo = GridRangeInfo.Table();
                GridRangeInfo selRange = GridRangeInfo.Empty;
                int           rowIndex, colIndex;
                if ((options & GridFindTextOptions.SelectionOnly) != GridFindTextOptions.None)
                {
                    selRange = gridControl1.Selections.Ranges.ActiveRange;
                }

                else if ((options & GridFindTextOptions.ColumnOnly) != GridFindTextOptions.None)
                {
                    selRange = GridRangeInfo.Col(gridControl1.CurrentCell.ColIndex);
                }

                else if ((options & GridFindTextOptions.WholeTable) != GridFindTextOptions.None)
                {
                    selRange = GridRangeInfo.Cells(1, 1, gridControl1.RowCount, gridControl1.ColCount);
                }

                clearHighlight();

                int startTop  = selRange.Top;
                int startLeft = selRange.Left;

                do
                {
                    GridStyleInfo        style    = gridControl1[startTop, startLeft];
                    GridCellRendererBase renderer = gridControl1.CellRenderers[style.CellType];
                    if (renderer.FindText(cmbSearch.Text, startTop, startLeft, options, true))
                    {
                        gridControl1.CurrentCell.GetCurrentCell(out rowIndex, out colIndex);
                        gridControl1[rowIndex, colIndex].BackColor = Color.Orange;
                    }
                } while (GridFindReplaceDialogSink.GetNextCell(selRange, ref startTop, ref startLeft, false, chkSearchUp.Checked));
            }
            this.highlighttext.HighlightText = "";
            this.gridControl1.Refresh();
            this.checkBox1.CheckState = CheckState.Unchecked;
        }
Beispiel #21
0
      public void GridSettin(ChildForm childform)
      {
          childform.DG.TableDescriptor.VisibleColumns.Remove("Barcode");
          childform.DG.TableDescriptor.VisibleColumns.Remove("ProductItemID");
          childform.DG.TableDescriptor.VisibleColumns.Remove("AltBarcode");
          childform.DG.TableDescriptor.VisibleColumns.Remove("Max");
          childform.DG.TableDescriptor.VisibleColumns.Remove("Min");
          childform.DG.TableDescriptor.VisibleColumns.Remove("ROP");
          childform.DG.TableControl.CurrentCell.ShowErrorIcon = true;
          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_1M");
          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_2M");
          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_3M");


          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_1M_D");
          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_2M_D");
          childform.DG.TableDescriptor.VisibleColumns.Remove("B3_3M_D");
          childform.DG.TableDescriptor.VisibleColumns.Add("ItemDescription");
          childform.DG.TableDescriptor.VisibleColumns.Add("MOQ");
          childform.DG.TableDescriptor.VisibleColumns.Add("Inventory");
          childform.DG.TableDescriptor.VisibleColumns.Add("DOS");
          childform.DG.TableDescriptor.VisibleColumns.Add("Sugg");
          childform.DG.TableDescriptor.VisibleColumns.Add("FinalPC");
          childform.DG.TableDescriptor.VisibleColumns.Add("OrderCTN");
          childform.DG.TableDescriptor.VisibleColumns.Add("MOQUnit");
          childform.DG.TableDescriptor.VisibleColumns.Add("Cost");
          childform.DG.TableDescriptor.VisibleColumns.Add("Total");
          childform.DG.TableDescriptor.VisibleColumns.Add("B1_1M");
          childform.DG.TableDescriptor.VisibleColumns.Add("B1_2M");
          childform.DG.TableDescriptor.VisibleColumns.Add("B1_3M");
          childform.DG.TableDescriptor.VisibleColumns.Add("B2_1M");
          childform.DG.TableDescriptor.VisibleColumns.Add("B2_2M");
          childform.DG.TableDescriptor.VisibleColumns.Add("B2_3M");
          childform.DG.TableDescriptor.VisibleColumns.Add("Total_1M");
          childform.DG.TableDescriptor.VisibleColumns.Add("Total_2M");
          childform.DG.TableDescriptor.VisibleColumns.Add("Total_3M");
          childform.DG.TableDescriptor.VisibleColumns.Add("ShabanLY");
          childform.DG.TableDescriptor.VisibleColumns.Add("RamazanLY");



          childform.DG.Refresh();
          childform.DG.Invalidate();
          childform.DG.TableControl.RefreshRange(GridRangeInfo.Table());
      }
Beispiel #22
0
        /// <summary>
        /// Setting GridGrouping control Properties
        /// </summary>
        private void GridSettings()
        {
            InitalizeGrid();
            gridCtrl.InitializeCols();
            gridCtrl.Grid.GridVisualStyles    = GridVisualStyles.Metro;
            gridCtrl.Grid.TableStyle.WrapText = false;

            this.gridCtrl.Grid.ListBoxSelectionMode = SelectionMode.MultiExtended;

            //used to set GridCaptionRowHeight.
            this.gridCtrl.Grid.DefaultRowHeight = (int)DpiAware.LogicalToDeviceUnits(25.0f);
            this.gridCtrl.Grid.RowHeights[0]    = (int)DpiAware.LogicalToDeviceUnits(30.0f);
            this.gridCtrl.Grid.RowHeights[1]    = (int)DpiAware.LogicalToDeviceUnits(30.0f);
            this.gridCtrl.Grid.ColWidths.ResizeToFit(GridRangeInfo.Table());

            //tab key navigation set as false to move the next control
            this.gridCtrl.Grid.WantTabKey = false;
        }
Beispiel #23
0
        private void GridSettings()
        {
            gridControl1.ControllerOptions           = GridControllerOptions.All & (~GridControllerOptions.OleDataSource);
            this.gridControl1.DefaultRowHeight       = 18;
            this.gridControl1.DefaultColWidth        = 100;
            this.gridControl1.DefaultGridBorderStyle = GridBorderStyle.None;
            this.gridControl1.Properties.RowHeaders  = false;
            this.gridControl1.CellDoubleClick       += new GridCellClickEventHandler(gridControl1_CellDoubleClick);
            this.gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table());
            this.gridControl1.TableStyle.Trimming           = StringTrimming.EllipsisCharacter;
            this.gridControl1.GridVisualStyles              = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            this.gridControl1.ListBoxSelectionMode          = SelectionMode.One;
            this.gridControl1.AllowProportionalColumnSizing = true;
            this.gridControl1.BrowseOnly = true;

            //tab key navigation set as false to move the next control
            this.gridControl1.WantTabKey = false;
        }
Beispiel #24
0
        private void BuscarRucGrilla()
        {
            options  = GridFindTextOptions.MatchWholeCell;
            options |= GridFindTextOptions.WholeTable;
            locInfo  = GridRangeInfo.Table();

            if (txtRuc.Text != "")
            {
                frEvents = new GridFindReplaceEventArgs(txtRuc.Text, "", options, locInfo);

                /*locInfo = GridRangeInfo.Table();
                 *
                 *
                 * frEvents = new GridFindReplaceEventArgs(txtSearch.Text, "", options, locInfo);
                 * if (frDialog.Find(frEvents) == null)
                 *  MessageBox.Show("No Matches found for Text" + txtSearch.Text);*/
            }
        }
Beispiel #25
0
        /// <summary>
        /// A method that performs print operation.
        /// </summary>
        /// <param name="obj"></param>
        private void Print(object obj)
        {
            PivotGridControl pivotGrid1  = obj as PivotGridControl; // obj refers to PivotGridControl object
            Window           printWindow = new Window();

            if (pivotGrid1 != null)
            {
                pivotGrid1.InternalGrid.PrintRange = GridRangeInfo.Table();
                PivotGridPrintDocument printDocument = new PivotGridPrintDocument(pivotGrid1);
                printDocument.Margin = new Thickness(20);
                PrintPreviewControl navigationControl = new PrintPreviewControl(printDocument);
                navigationControl.HeaderTemplate = this.HeaderTemplate;
                navigationControl.FooterTemplate = this.FooterTemplate;
                printWindow.Title   = "Print Preview";
                printWindow.Content = navigationControl;
            }
            printWindow.ShowDialog();
        }
Beispiel #26
0
        private void GridSetting()
        {
            GridConditionalFormatDescriptor format1 = new GridConditionalFormatDescriptor();

            format1.Appearance.AnyRecordFieldCell.TextColor = Color.Black;
            format1.Appearance.AnyRecordFieldCell.Interior  = new BrushInfo(Color.LightGreen);

            format1.Expression = "[Status]='Sent' OR [Status]='SENT' ";


            DG2.TableDescriptor.ConditionalFormats.Add(format1);


            DG2.ThemesEnabled = false;
            DG2.Appearance.ColumnHeaderCell.Themed    = false;
            DG2.Appearance.ColumnHeaderCell.Interior  = new BrushInfo(GradientStyle.Vertical, Color.LightSkyBlue, Color.White);
            DG2.Appearance.ColumnHeaderCell.TextColor = Color.Black;
            DG2.TableDescriptor.VisibleColumns.Remove("VendorID");

            DG2.TableDescriptor.Appearance.AnyCell.TextColor       = Color.Black;
            DG2.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Arial", 10f, FontStyle.Regular));
            DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Left;
            DG2.TableDescriptor.Columns["Vendor"].Appearance.AnyRecordFieldCell.WrapText            = true;
            DG2.TableDescriptor.Columns["Vendor"].Width = 250;
            DG2.TableDescriptor.Columns["Email"].Width  = 150;

            DG2.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
            DG2.TopLevelGroupOptions.ShowCaption = false;
            DG2.AllowProportionalColumnSizing    = false;



            GridMetroColors colors = new GridMetroColors();

            colors.PushButtonColor.NormalBackColor = Color.FromArgb(22, 165, 220);
            colors.PushButtonColor.HoverBackColor  = Color.FromArgb(26, 198, 255);
            colors.PushButtonColor.PushedBackColor = Color.FromArgb(120, 191, 217);
            this.DG2.SetMetroStyle(colors);

            DG2.TableDescriptor.AllowNew = false;
            DG2.Refresh();
            DG2.Invalidate();
            DG2.TableControl.RefreshRange(GridRangeInfo.Table());
        }
Beispiel #27
0
        public testjobview(string content, string tooltype, string shipdate)
        {
            NoChildBMP = 2;
            OpenedBMP  = 0;
            ClosedBMP  = 1;



            strJobNumber = content;



            InitializeComponent();
            SampleCustomization();
            SampleData(strJobNumber);
            // SampleData(content);
            GridSettings();

            lblBase.Text     = content;
            lblType.Text     = tooltype;
            lblShipdate.Text = "Job Ships: " + shipdate;

            commentsTableAdapter.fillComments(dsComments.comments, strJobNumber);
            actionItemsTableAdapter1.FillBy(this.ds_ActionItems.ActionItems, strJobNumber);

            //g1.SetColHidden(1,1,true);
            //g1.SetColHidden(4, 4, true);

            g2.TableDescriptor.VisibleColumns.Remove("baseid");
            g2.TableDescriptor.VisibleColumns.Remove("id");

            g2.TableDescriptor.Appearance.AnyRecordFieldCell.WrapText = true;
            g2.TableModel.RowHeights.ResizeToFit(GridRangeInfo.Table());

            g2.TableModel.ReadOnly = false;

            g2.TableDescriptor.Columns[1].HeaderText = "Comment";

            g2.TableDescriptor.Columns["date"].Appearance.AnyRecordFieldCell.Format = "MM/dd/yyyy";

            margin_Over_timeTableAdapter.BaseQuery(this.marginOverTime.Margin_Over_time, strJobNumber);
        }
Beispiel #28
0
        public override void CreateRendererElement(UserControl1 uiElement, GridRenderStyleInfo style)
        {
            var range = this.GridControl.Model.SelectedRanges;
            var grid  = uiElement.child;

            if (range != null && range.AnyRangeContains(GridRangeInfo.Cell(style.CellIdentity.RowIndex, style.CellIdentity.ColumnIndex)))
            {
                if (grid.Model.SelectedRanges.Count == 0)
                {
                    grid.Model.SelectedRanges.Add(GridRangeInfo.Table());
                    grid.InvalidateCell(GridRangeInfo.Cell(0, 0));
                }
            }
            else
            {
                grid.Model.SelectedRanges.Clear();
                grid.InvalidateCells();
            }
            base.CreateRendererElement(uiElement, style);
        }
Beispiel #29
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog
            {
                DefaultExt  = ".pdf",
                Filter      = "Adobe PDF Files(*.pdf)|*.pdf",
                FilterIndex = 1
            };
            PdfDocument document;

            if (sfd.ShowDialog() == true)
            {
                using (Stream stream = sfd.OpenFile())
                {
                    DrawingHeaderFooter();
                    document = this.grid.Model.ExportToPdfLightTableDocument(GridRangeInfo.Table());
                    document.Save(stream);
                    Process.Start(sfd.FileName);
                }
            }
        }
Beispiel #30
0
 void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (this.checkBox1.Checked)
     {
         gridControl1.BeginUpdate();
         gridControl1.RowHeights.ResizeToFit(GridRangeInfo.Table());
         gridControl1.ColWidths.ResizeToFit(GridRangeInfo.Table());
         gridControl1.EndUpdate(true);
     }
     else
     {
         gridControl1.BeginUpdate();
         for (int i = 2; i <= 6; i++)
         {
             gridControl1.RowHeights[i] = rowsize;
             gridControl1.ColWidths[i]  = colsize;
         }
         gridControl1.EndUpdate(true);
     }
     this.gridControl1.Refresh();
 }