-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix #13071 Changing properties with RefreshProperties.All does not requery the property list in the PropertyGrid in .net 9 (worked in .net 8) #13295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!Adding a new Flag is indeed a good idea.
@Epica3055 - is it possible to add unit test? Please send to @Olina-Zhang's team for testing |
src/test/unit/System.Windows.Forms/System/Windows/Forms/PropertyGridTests.cs
Show resolved
Hide resolved
0d58217
to
ccd78fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, nice fix! Please backport it to 9!
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/winforms/actions/runs/14612889585 |
@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 128 Please backport manually! |
…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 -->
Fixes #13071
Proposed changes
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.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