PropertyGrid: ExpandAllGridItems() on hidden control causes NullRefException on Form Dispose
See original GitHub issue- .NET Core Version: 3.1
- Have you experienced this same bug with .NET Framework?: No (tested with identical design)
Problem description:
I am using a propertygrid control on a TabControl.
The propertygrid is located on the second TabPage, which is not the selected index when the application starts.
On creating the form, I assign a simple dataobject to the propertygrid (I picked “Color” as an example, works for all objects as far as I know).
After that, I call ExpandAllGridItems().
Here is the setup, as simple as possible:
The bug :
If you close the form before opening the selected “hidden tabPage” at least once, the following exception occurs (while disposing the form):
If you select the “hidden tabPage” first and close the form afterwards (even if not in focus anymore), the form closes without any errors.
Expected behavior: I would expect to get no exception. I tried the same setup in .NET Framework 4.8 with no errors.
Minimal repro: GridControl_Dispose_bug.zip
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Verified this issue with the .NET SDK 5.0.9, the issue has been fixed that no exception pops up.
Verified this issue with the .NET SDK 3.1.412, the issue has been fixed that no exception pops up.