Commit b33f1ba
committed
Add _isReleasingDataSource to prevent unnecessary operations on CurrentCell when changing or releasing DataSource (#13320)
Fixes #13304
Root cause
Regression introduced in PR #4637
When closing the dialog in edit mode, DataSource is set to null, and then CurrentCell = null is set. Then unnecessary method EndEdit of the SetCurrentCellAddressCore is called.
Proposed changes
Add _isReleasingDataSource in DataGridView and set it to null in property DataSource before setting CurrentCell = null to prevent the EndEdit method of the SetCurrentCellAddressCore from being called
Customer Impact
When the DataGridView is in editing mode, its dialog box can be closed normally
Regression?
Yes
Risk
Minimal1 parent 32b207b commit b33f1ba
File tree
2 files changed
+14
-2
lines changed- src/System.Windows.Forms/src/System/Windows/Forms
2 files changed
+14
-2
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27462 | 27462 | | |
27463 | 27463 | | |
27464 | 27464 | | |
27465 | | - | |
| 27465 | + | |
| 27466 | + | |
27466 | 27467 | | |
27467 | 27468 | | |
27468 | 27469 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
2044 | 2045 | | |
2045 | 2046 | | |
2046 | 2047 | | |
2047 | | - | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2048 | 2059 | | |
2049 | 2060 | | |
2050 | 2061 | | |
| |||
0 commit comments