I am working with a DataGridView
in winforms that I am handling the CellPainting
event for to paint all the cells myself.
My grid is virtual and has all of it's data stored in a custom data structure centered around a MemoryStream
.
All of my painting has been going fine, until a user Shift + clicks to select a large range of cells at once (25,000+), which have to be added to a selected cells collection, have a bunch of flags set, and other performance-draining operations.
Is there any way to prevent the DataGridView from "selecting" a cell so I can handle this operation separately in a more efficient manner?