ConfigRawParams: fix search slowdown #3149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We unwittingly introduced a search slowdown in #3130. The auto column width is terribly optimized reruns any time a row's visibility is changed, and
SuspendLayout
isn't helping like I'd think it would.To fix this, I have the auto width turn on and off. I changed the default column width mode for the entire data grid to
AllCells
, and changed theNotSet
columns toNone
, and changed theAllCells
columns toNotSet
. Anywhere whereSuspendLayout
was being called, I addedParams.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
, and restored the auto size whereverResumeLayout
was called (I actually implemented this in a helper function instead of copy/pasting that all 4 places).We could also probably just go to fixed widths, but I'm happy enough with this approach now.