Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Long Delay Between DataGridView Column Header Click and Firing of the ColumnHeaderMouseClick Event

$
0
0

I have a somewhat large 6500 row / 24 column (mostly string with some double and bool columns) DataTable assigned to the DataSource property of a DataGridView.  I have registered the ColumnHeaderMouseClick event so that I can take some action when the user clicks on the column header.  I am experiencing a very long delay between the click and the triggering of a breakpoint on the first statement in the event handler.  I am using Visual Studio Community 2017.  Any thoughts on what's causing the long delay?  The assigned properties of the DGV are shown below.

Thanks. Steve.

// From the Designer Code // // dgvData // this.dgvData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dgvData.BackgroundColor = System.Drawing.Color.White; this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvData.Location = new System.Drawing.Point(20, 44); this.dgvData.Name = "dgvData"; this.dgvData.Size = new System.Drawing.Size(1161, 253); this.dgvData.TabIndex = 9; this.dgvData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvData_CellContentClick); this.dgvData.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvData_CellValueChanged); this.dgvData.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.Dgv_ColumnHeaderMouseClick); this.dgvData.UserDeletedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.DgvData_UserDeletedRow); this.dgvData.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.DgvData_UserDeletingRow); // From my hand code dgvData.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText; dgvData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

dgvData.AllowUserToResizeColumns = true;

dgvData.EditMode = DataGridViewEditMode.EditOnEnter; dgvData.RowHeadersVisible = true;




Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>