fix #13071 Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) #13295
Merged
Epica3055 merged 2 commits intodotnet:mainfrom Apr 23, 2025
Conversation
…not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) : revert PR#12431 , use another approach.
50fac01 to
c590898
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13295 +/- ##
===================================================
+ Coverage 61.34314% 62.56834% +1.22520%
===================================================
Files 1547 1560 +13
Lines 158479 159675 +1196
Branches 14751 14904 +153
===================================================
+ Hits 97216 99906 +2690
+ Misses 60561 59000 -1561
- Partials 702 769 +67
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
LeafShi1
previously approved these changes
Apr 15, 2025
Member
LeafShi1
left a comment
There was a problem hiding this comment.
LGTM!Adding a new Flag is indeed a good idea.
Contributor
|
@Epica3055 - is it possible to add unit test? Please send to @Olina-Zhang's team for testing |
Member
Epica3055
commented
Apr 17, 2025
src/test/unit/System.Windows.Forms/System/Windows/Forms/PropertyGridTests.cs
Show resolved
Hide resolved
0d58217 to
ccd78fc
Compare
Tanya-Solyanik
approved these changes
Apr 23, 2025
Contributor
Tanya-Solyanik
left a comment
There was a problem hiding this comment.
Thank you, nice fix! Please backport it to 9!
Member
Author
|
/backport to release/9.0 |
Contributor
|
Started backporting to release/9.0: https://github.com/dotnet/winforms/actions/runs/14612889585 |
Contributor
|
@Epica3055 backporting to release/9.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: fix #13071 Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) : revert PR#12431 , use another approach.
Using index info to reconstruct a base tree...
A src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/GridEntry.GridEntryAccessibleObject.cs
A src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.Flags.cs
A src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs
Falling back to patching base and 3-way merge...
Auto-merging src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs
CONFLICT (content): Merge conflict in src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/PropertyGridView.cs
Auto-merging src/System.Windows.Forms/src/System/Windows/Forms/Controls/PropertyGrid/PropertyGridInternal/GridEntry.GridEntryAccessibleObject.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 fix #13071 Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) : revert PR#12431 , use another approach.
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Tanya-Solyanik
added a commit
that referenced
this pull request
May 8, 2025
…ll does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) (#13356) Backport of [#13295](#13295) to release/9.0 Fixes #13071 ## Proposed changes - - revert [PR#12431](#12431) , use another approach to fix [Issue#12440](#12440) - Introduce `EditMouseDown` flag in PropertyGridView.flag. This flag is on when the TextBox in the PropertyGrid.GridEntry is focused and is off when editing is done. - The cause of [Issue#12440](#12440) is that after editing is done, GridEntryAccessibleObject will raise AutomationFocusChangedEvent GridEntry.GridEntryAccessibleObject.cs ``` c# ... internal override void SetFocus() { if (PropertyGridView is null || !PropertyGridView.IsHandleCreated) { return; } base.SetFocus(); RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId); } ``` So in order to not let TextBox loose rectangle, add conditions to that event to exclude two cases: 1. when InPropertySet is on 2. when EditMouseDown is on ## Regression? - Yes <!-- ## Customer Impact - - ## Risk - --> ## Screenshots <!-- Remove this section if PR does not change UI --> ### Before GetProperties method didn't get invoked described in [#13071](#13071) ### After https://github.com/user-attachments/assets/4d013d27-8ebc-4020-a977-d2f825280bfc https://github.com/user-attachments/assets/7885c561-f37f-45fd-971c-6af9686db030 ## Test methodology <!-- How did you ensure quality? --> - - manually - <!-- ## Accessibility testing -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13071
Proposed changes
EditMouseDownflag in PropertyGridView.flag. This flag is on when the TextBox in the PropertyGrid.GridEntry is focused and is off when editing is done.GridEntry.GridEntryAccessibleObject.cs
So in order to not let TextBox loose rectangle, add conditions to that event to exclude two cases:
Regression?
Screenshots
Before
GetProperties method didn't get invoked described in #13071
After
Issues13071.01.mp4
Issues13071.02.mp4
Test methodology
Test environment(s)
10.0.0-preview.3.25165.3