/// <summary>Setup a new grids control (micro, sub or macro).</summary> /// <param name="parentRowControl">The parent control.</param> /// <param name="gridControl">The grid control.</param> /// <param name="width">The width.</param> /// <param name="color"></param> /// <exception cref="System.ArgumentNullException"> /// </exception> private void GridControl_SetupBlock(IGridControl parentRowControl, IGridControl gridControl, int width, Color color) { #region Check input parameters // Check the control if (gridControl == null) { throw new ArgumentNullException(gridControl.ToString()); } // Check parent if (parentRowControl == null) { throw new ArgumentNullException(parentRowControl.ToString()); } var parent = parentRowControl as GridControl_Row; if (parent == null) { throw new ArgumentNullException(parent.ToString()); } #endregion // Set the parent & add events var control = gridControl as Control; if (control != null) { if (control.Parent != parent) { parent.Controls.Add(control); } control.Click -= ClickEvent; control.Click += ClickEvent; control.BringToFront(); control.Dock = DockStyle.Left; control.Top = 0; control.Left = 0; control.Width = width; control.BackColor = color; } #region These properties are not used //gridBlock.Height = 20; // The height does not matter //gridBlock.BackColor = System.Drawing.Color.White; //button.UseVisualStyleBackColor = false; #endregion }
/// <summary>Setup a new row control.</summary> /// <param name="parentControl">The parent control.</param> /// <param name="rowControl">The row control.</param> /// <param name="height">The height.</param> /// <exception cref="System.ArgumentNullException"> /// </exception> private void GridControl_SetupRow(IGridControl parentControl, IGridControl rowControl, int height) { #region Check input parameters // Check row if (rowControl == null) { throw new ArgumentNullException(rowControl.ToString()); } var row = rowControl as GridControl_Row; if (row == null) { throw new ArgumentNullException(row.ToString()); } // Check parent if (parentControl == null) { throw new ArgumentNullException(parentControl.ToString()); } var parent = parentControl as GridControl_Block; if (parent == null) { throw new ArgumentNullException(parent.ToString()); } #endregion if (row.Parent != parent) { parent.Controls.Add(row); } row.BringToFront(); row.BorderStyle = BorderStyle.FixedSingle; row.Dock = DockStyle.Top; row.Location = new Point(3, 16); //rowPanel.Name = name; row.Height = height; //panel.TabIndex = 2; //row.Click -= ClickEvent; //row.Click += ClickEvent; }