2

Selecting data in a DataGridView with shift+mouse click is very slow as soon as there are some more rows. Also programmatically selecting cells by DataGridView1[col, row].Selected = true is very slow, about 1 second for every 100 cell selected. I'm working with datasets with 5000-20000 rows, and I need to be able to select cells for copy/paste operations.

  1. Is there some way to speed up the selection method?

  2. And if not, how can I prevent selection from happening when the user uses shift + mouse click? As this will freeze the program for several minutes if the user tries to do a large selection.

1 Answers1

0

Try to disable the AutomationPeer. For me, disable AutomationPeer give me a huge performance boost.

See here for how to disable AutomationPeer:

Can UI Automation be disabled for an entire WPF 4.0 app?

zhongshu
  • 7,748
  • 8
  • 41
  • 54