This is not a question, because I already answered it. But it can be useful for others.
Here's what happens:
- Create a WinForm with Datagridview and bind a Subsonic ... Collection with over 500 objects loaded into it.
- Add some columns to the datagrid and make at least one autosizemode = fill
- Add logic to delete all selected columns (i.e., on the keyboard → delete)
- Mark all entries and delete them
It takes about 30 seconds. on the high end of the PC (and scaled: 1 min per 1000 ...)
Cause:
Each time you delete a row, ListChanged events are generated that cause the datagridview to recalculate the space required for the authorized column (if someone is interested in the "internals", I linked the call schedule.
source
share