-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
"Object reference not set to an instance of an object" exception pops up after clicked the DataGridViewCell content #12692
Comments
This issue caused by PR #10406, when executing winforms/src/System.Windows.Forms/src/System/Windows/Forms/Controls/DataGridView/DataGridViewCell.cs Line 3040 in 9007f33
|
@merriemcgaw, @lonitra - this is an internal find, but it impactful because it is a crash, I would service it to NET9, what do you guys think? Never mind, this is a feedback issue, we should service it. |
@Zheng-Li01 thank you for providing a scratch project repro! You can also paste a link to your private branch with the repro case. Just a suggestion - sometimes it might be easier to create a unit test that repros the issue, for example in this case - copy/paste the user event handler into the unit test. |
Confirming - is this an issue that happens to all users at runtime when they click on the contents of the DGV cell? If so, let's mark this for servicing as soon as we have a confident working fix. This is a regression that will impact people significantly! |
@merriemcgaw - not really for all users, only if the row is deleted when the cell is clicked. But the point stays, we should fix it - this is a user-reported bug. |
Verified the issue with latest .NET SDK 10.0.100-alpha.1.25065.19 build, this issue has been fixed, no exception pops up after clicked DataGridViewCell content. 12692.mp4 |
Our app is currently crashing a lot because of this bug. How will the fix be available? Do we have to wait for .net 10 next fall? |
@nRoger-Env - this fix will be shipped in the February servicing release. #12742 |
Verified with .NET SDK 9.0.2 test pass build, the issue has been fixed same as above test results. |
Verified with .NET SDK 10.0 P1 test pass build, it was fixed as above testing result. |
.NET version
.NET SDK 10.0.100-alpha.1.24627,3
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
The issue can reproduce on latest .NET SDK 10.0 and 9.0, can't reproduce on .NET 8.0
Issue description
Actual Results:
Object reference not set to an instance of an object exception pops up after clicked the DataGridViewCell content, and the DGV working well if comment the below code line: in LoadData method
DataGridView1.Rows.Clear();
Expected Results:
![Image](https://private-user-images.githubusercontent.com/38325459/399204776-d2904716-f47a-4811-b54a-774cf2ca50ac.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MjI0MjQsIm5iZiI6MTczOTQyMjEyNCwicGF0aCI6Ii8zODMyNTQ1OS8zOTkyMDQ3NzYtZDI5MDQ3MTYtZjQ3YS00ODExLWI1NGEtNzc0Y2YyY2E1MGFjLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA0NDg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjZDk1OTMxODZjZmRhMzhjNjUwOGEzMDc5ZGQxZWIwOWY2N2JjOWI2ODY5NDVjZTQzZjgyOWQ4MjQxOTYxMTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U09Gq-WOLnNcVaai-n6Y9dW5yxG8sRYz9Hxmfs8D8xY)
Call Stack
![Image](https://private-user-images.githubusercontent.com/38325459/399204835-ec78f217-c15b-4a39-929b-bffc99ddd809.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MjI0MjQsIm5iZiI6MTczOTQyMjEyNCwicGF0aCI6Ii8zODMyNTQ1OS8zOTkyMDQ4MzUtZWM3OGYyMTctYzE1Yi00YTM5LTkyOWItYmZmYzk5ZGRkODA5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1Dc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0QWOD-Gr2BeJngMWlFfQ6imOP8ahjU2bR9lkc)
DebugInfo.txt
Steps to reproduce
Or using the ScratchProject.zip in the dotnet/winforms repo
Original the FeedBack: https://developercommunity.visualstudio.com/t/NullReferenceException-in-DataGridView/10819893
The text was updated successfully, but these errors were encountered: