Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGridView InvalidOperationException: This operation cannot be performed while an auto-filled column is being resized. #1830

Closed
kirsan31 opened this issue Sep 9, 2019 · 3 comments
Labels
🪲 bug Product bug (most likely)

Comments

@kirsan31
Copy link
Contributor

kirsan31 commented Sep 9, 2019

  • .NET Core Version: 3.0 Preview9
  • Have you experienced this same bug with .NET Framework?: Yes

Problem description:
stackoverflow
DataGridView with AutoSizeMode == Fill and ColumnHeadersHeightSizeMode == AutoSize. The problem is that if the mouse cursor accidentally hovers the upper left cell of the grid when the form loads, the application throws an InvalidOperationException.

The code is trying to access dataGridView.TopLeftHeaderCell, which when happens for the first time actually creates that cell and triggers some layout actions not expected at that moment.
Fix: We need to make sure that the TopLeftHeaderCell is created before DataGridView handle.

Actual behavior:
InvalidOperationException: This operation cannot be performed while an auto-filled column is being resized.

Expected behavior:
No Exception.

Minimal repro:
DataGridViewTest.zip

@RussKie RussKie added this to the 3.1 milestone Sep 9, 2019
@RussKie RussKie added the 🪲 bug Product bug (most likely) label Sep 9, 2019
@RussKie RussKie modified the milestones: 3.1, Future Sep 9, 2019
@JeremyKuhne JeremyKuhne added the help wanted Good issue for external contributors label Aug 11, 2020
@kirsan31
Copy link
Contributor Author

It's strange but I can't repro this issue any more with .net core 3.1 and .net5.0 😲 It's even not repro with old 3.0 Preview9 binary and 3.1.9 runtime. And it's stably reproducible on net472.
Besides runtime change, old test was on Windows7 and now I am testing on Win10 (2004)... Any thoughts?:thinking:

@RussKie
Copy link
Member

RussKie commented Nov 23, 2020

If we can't repro this on .NET 5.0 then I think we can close it. If this comes back we can reopen and investigate then.

@RussKie RussKie added the 📭 waiting-author-feedback The team requires more information from the author label Nov 23, 2020
@kirsan31
Copy link
Contributor Author

Just tested this on Windows7 and .Net5.0 runtime - no exception 👍

@ghost ghost removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 23, 2020
@RussKie RussKie removed the help wanted Good issue for external contributors label Nov 23, 2020
@RussKie RussKie removed this from the Future milestone Nov 23, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🪲 bug Product bug (most likely)
Projects
None yet
Development

No branches or pull requests

3 participants