public void WireGridAwareTextBox(GridAwareTextBox gridAwareTextBox, GridControlBase grid, bool range) { this._grid = grid; this.gridAwareTextBox = gridAwareTextBox; this.gridAwareTextBox.BorderStyle = BorderStyle.FixedSingle; this.rangeofgrid = range; //Assign the current selection range to NameBox if (rangeofgrid) { this.TextBoxValue = string.Format("R{0}C{0}", grid.CurrentCell.RowIndex, grid.CurrentCell.ColIndex); } #region [Events] this._grid.Model.SelectionChanged += new GridSelectionChangedEventHandler(Model_SelectionChanged); this._grid.CurrentCellMoved += new GridCurrentCellMovedEventHandler(_grid_CurrentCellMoved); this.gridAwareTextBox.TextChanged += new EventHandler(gridAwareTextBox_TextChanged); #endregion }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { Syncfusion.Windows.Forms.Grid.GridCellInfo gridCellInfo1 = new Syncfusion.Windows.Forms.Grid.GridCellInfo(); Syncfusion.Windows.Forms.Grid.GridCellInfo gridCellInfo2 = new Syncfusion.Windows.Forms.Grid.GridCellInfo(); Syncfusion.Windows.Forms.Grid.GridCellInfo gridCellInfo3 = new Syncfusion.Windows.Forms.Grid.GridCellInfo(); Syncfusion.Windows.Forms.Grid.GridCellInfo gridCellInfo4 = new Syncfusion.Windows.Forms.Grid.GridCellInfo(); this.gridAwareTextBox1 = new Syncfusion.Windows.Forms.Grid.GridAwareTextBox(); this.gridControl1 = new Syncfusion.Windows.Forms.Grid.GridControl(); ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit(); this.SuspendLayout(); // // gridAwareTextBox1 // this.gridAwareTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gridAwareTextBox1.AutoSuggestFormula = false; this.gridAwareTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.gridAwareTextBox1.DisabledBackColor = System.Drawing.SystemColors.Window; this.gridAwareTextBox1.EnabledBackColor = System.Drawing.SystemColors.Window; this.gridAwareTextBox1.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.gridAwareTextBox1.Location = new System.Drawing.Point(12, 12); this.gridAwareTextBox1.Name = "gridAwareTextBox1"; this.gridAwareTextBox1.Size = new System.Drawing.Size(764, 27); this.gridAwareTextBox1.TabIndex = 4; // // gridControl1 // this.gridControl1.DpiAware = true; this.gridControl1.AlphaBlendSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(94)))), ((int)(((byte)(171)))), ((int)(((byte)(222))))); this.gridControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gridControl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.gridControl1.DefaultGridBorderStyle = Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid; this.gridControl1.Font = new System.Drawing.Font("Segoe UI", 9F); gridCellInfo1.Col = -1; gridCellInfo1.Row = -1; gridCellInfo1.StyleInfo.Font.Bold = false; gridCellInfo1.StyleInfo.Font.Facename = "Segoe UI"; gridCellInfo1.StyleInfo.Font.Italic = false; gridCellInfo1.StyleInfo.Font.Size = 9F; gridCellInfo1.StyleInfo.Font.Strikeout = false; gridCellInfo1.StyleInfo.Font.Underline = false; gridCellInfo1.StyleInfo.Font.Unit = System.Drawing.GraphicsUnit.Point; gridCellInfo2.Col = -1; gridCellInfo2.Row = -1; gridCellInfo2.StyleInfo.Font.Bold = false; gridCellInfo2.StyleInfo.Font.Facename = "Segoe UI"; gridCellInfo2.StyleInfo.Font.Italic = false; gridCellInfo2.StyleInfo.Font.Size = 8.25F; gridCellInfo2.StyleInfo.Font.Strikeout = false; gridCellInfo2.StyleInfo.Font.Underline = false; gridCellInfo2.StyleInfo.Font.Unit = System.Drawing.GraphicsUnit.Point; gridCellInfo3.Col = -1; gridCellInfo3.Row = -1; gridCellInfo3.StyleInfo.Font.Bold = false; gridCellInfo3.StyleInfo.Font.Facename = "Segoe UI"; gridCellInfo3.StyleInfo.Font.Italic = false; gridCellInfo3.StyleInfo.Font.Size = 8.25F; gridCellInfo3.StyleInfo.Font.Strikeout = false; gridCellInfo3.StyleInfo.Font.Underline = false; gridCellInfo3.StyleInfo.Font.Unit = System.Drawing.GraphicsUnit.Point; gridCellInfo4.Col = -1; gridCellInfo4.Row = -1; gridCellInfo4.StyleInfo.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin); gridCellInfo4.StyleInfo.Borders.Right = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin); gridCellInfo4.StyleInfo.Font.Facename = "Segoe UI"; gridCellInfo4.StyleInfo.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.White); gridCellInfo4.StyleInfo.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138))))); this.gridControl1.GridCells.AddRange(new Syncfusion.Windows.Forms.Grid.GridCellInfo[] { gridCellInfo1, gridCellInfo2, gridCellInfo3, gridCellInfo4 }); //this.gridControl1.GridOfficeScrollBars = Syncfusion.Windows.Forms.OfficeScrollBars.Metro; //this.gridControl1.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro; this.gridControl1.DefaultRowHeight = (int)DpiAware.LogicalToDeviceUnits(20.0f); this.gridControl1.Location = new System.Drawing.Point(12, 44); //this.gridControl1.MetroScrollBars = true; this.gridControl1.Name = "gridControl1"; this.gridControl1.Properties.ForceImmediateRepaint = false; this.gridControl1.Properties.GridLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); this.gridControl1.Properties.MarkColHeader = false; this.gridControl1.Properties.MarkRowHeader = false; this.gridControl1.RowCount = 30; this.gridControl1.RowHeightEntries.AddRange(new Syncfusion.Windows.Forms.Grid.GridRowHeight[] { new Syncfusion.Windows.Forms.Grid.GridRowHeight(0, 29) }); this.gridControl1.Size = new System.Drawing.Size(764, 358); this.gridControl1.SmartSizeBox = false; this.gridControl1.TabIndex = 6; this.gridControl1.Text = "gridControl1"; this.gridControl1.ThemesEnabled = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(788, 414); this.Controls.Add(this.gridControl1); this.Controls.Add(this.gridAwareTextBox1); this.MinimumSize = new System.Drawing.Size(500, 400); this.Name = "Form1"; this.Text = "Formula Range Selection"; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }