Temat: DataGridView
Zaznaczałem pojedyncze komórki i udostępniam multiselect. Udało mi się trochę przyspieszyć o ok 30% przechodząc min. na zaznaczenie całych wierszy. Kod mojego Grida:
this.DGVDane.AllowUserToAddRows = false;
this.DGVDane.AllowUserToOrderColumns = true;
this.DGVDane.AllowUserToResizeRows = false;
this.DGVDane.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
this.DGVDane.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.DGVDane.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DGVDane.ContextMenuStrip = this.cmsMEnu;
this.DGVDane.Dock = System.Windows.Forms.DockStyle.Fill;
this.DGVDane.GridColor = System.Drawing.SystemColors.Desktop;
this.DGVDane.Location = new System.Drawing.Point(0, 0);
this.DGVDane.MultiSelect = false;
this.DGVDane.Name = "DGVDane";
this.DGVDane.ReadOnly = true;
this.DGVDane.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.HotTrack;
this.DGVDane.RowsDefaultCellStyle = dataGridViewCellStyle1;
this.DGVDane.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.DGVDane.Size = new System.Drawing.Size(806, 614);
this.DGVDane.TabIndex = 0;
this.DGVDane.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DGVDane_RowHeaderMouseClick);