question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: image image

The bug : If you close the form before opening the selected “hidden tabPage” at least once, the following exception occurs (while disposing the form): image

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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Jenna-Zhengcommented, Jul 20, 2021

Verified this issue with the .NET SDK 5.0.9, the issue has been fixed that no exception pops up.

0reactions
Philip-Wang01commented, Jul 30, 2021

Verified this issue with the .NET SDK 3.1.412, the issue has been fixed that no exception pops up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF PropertyGrid throws weird NullReferenceException ...
I am getting exceptions in the XCeed WPF propertygrid control when there are nested collection properties. The behavior is well defined and ...
Read more >
PropertyGrid Class (System.Windows.Forms)
You can hide a property so that it is not displayed in the PropertyGrid control by decorating it with the BrowsableAttribute and setting...
Read more >
DotNetBar for Windows Forms Release Notes
Fixed: Fixed a problem where attempting to dispose of Schedule Control resources during Visual Studio shutdown could cause an exception.
Read more >
Smart PropertyGrid changelog
There was a missing graphics.Dispose() call in the Trackbar inplace control. When the dropdown form of a UITypeEditor or List feel is visible,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found