System.Windows.Forms.DataGridView.OnHandleCreated(System.EventArgs)

Here are the examples of the csharp api class System.Windows.Forms.DataGridView.OnHandleCreated(System.EventArgs) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

1. Example

Project: LaserGRBL
Source File: MyDatagridView.cs
View license
protected override void OnHandleCreated(EventArgs e)
		{
			// Touching the TopLeftHeaderCell here prevents
			// System.InvalidOperationException:
			// This operation cannot be performed while
			// an auto-filled column is being resized.

			// https://github.com/arkypita/LaserGRBL/issues/171
			// https://stackoverflow.com/questions/34344499/invalidoperationexception-this-operation-cannot-be-performed-while-an-auto-fill
			// https://connect.microsoft.com/VisualStudio/feedback/details/481029/this-operation-cannot-be-performed-while-an-auto-filled-column-is-being-resized

			System.Windows.Forms.DataGridViewHeaderCell cell = TopLeftHeaderCell;
			base.OnHandleCreated(e);
		}

2. Example

Project: Analysis-Services
Source File: TreeGridView.cs
View license
protected override void OnHandleCreated(EventArgs e)
		{
			base.OnHandleCreated(e);

			// this control is used to temporarly hide the vertical scroll bar
			hideScrollBarControl = new Control();
			hideScrollBarControl.Visible = false;
			hideScrollBarControl.Enabled = false;
			hideScrollBarControl.TabStop = false;
			// control is disposed automatically when the grid is disposed
			this.Controls.Add(hideScrollBarControl);
		}

3. Example

Project: BismNormalizer
Source File: TreeGridView.cs
View license
protected override void OnHandleCreated(EventArgs e)
		{
			base.OnHandleCreated(e);

			// this control is used to temporarly hide the vertical scroll bar
			hideScrollBarControl = new Control();
			hideScrollBarControl.Visible = false;
			hideScrollBarControl.Enabled = false;
			hideScrollBarControl.TabStop = false;
			// control is disposed automatically when the grid is disposed
			this.Controls.Add(hideScrollBarControl);
		}