Fix ListView Details view cell retrieval and full-row accessibility - #15056
Fix ListView Details view cell retrieval and full-row accessibility#15056LeafShi1 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15056 +/- ##
=============================================
Coverage 37.24166% 37.24166%
=============================================
Files 246 246
Lines 9774 9774
Branches 1029 1029
=============================================
Hits 3640 3640
Misses 5970 5970
Partials 164 164
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.
🟡 Changes recommended
The new FullRowSelect Name logic can drop the base item text (e.g., when there are zero columns) and has avoidable side effects/allocations that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes UIA Grid/Table behavior for ListView in View.Details by returning real cell providers from GridPattern.GetItem(row, column), and improves full-row selection announcements by including all column values in the row accessible name.
Changes:
- Override
ListViewAccessibleObject.GetItem(row, column)to return the correct sub-item accessible object in Details view. - Update Details-view item accessible
NameforFullRowSelectto surface all column values. - Add a unit test covering
GetItem(row, column)returning the expected sub-item provider.
File summaries
| File | Description |
|---|---|
| src/test/unit/System.Windows.Forms/System/Windows/Forms/AccessibleObjects/ListVIew.ListViewAccessibleObjectTests.cs | Adds a regression test for ListViewAccessibleObject.GetItem in Details view (with/without images). |
| src/System.Windows.Forms/System/Windows/Forms/Controls/ListView/ListViewItem.ListViewItemDetailsAccessibleObject.cs | Changes the accessible row Name behavior for FullRowSelect in Details view. |
| src/System.Windows.Forms/System/Windows/Forms/Controls/ListView/ListView.ListViewAccessibleObject.cs | Implements GridPattern.GetItem(row, column) for Details-mode ListView. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…w names. Preserve the item name when no columns exist and add regression tests.
Fixes #15044
Root Cause
ListView in Details view advertises UIA Grid and Table patterns but did not override
GridPattern.GetItem(row, column). The base implementation returned null, even though the corresponding cell existed in the UIA tree.Additionally, full-row mouse hit testing returned individual cells while selection events targeted the row, resulting in incomplete announcements.
Proposed changes
GridPattern.GetItem(row, column)forListViewin Details view so it returns the correct cell accessible object.Customer Impact
Regression?
Risk
Screenshots
Before
GridPattern.GetItem()returned an empty provider. Screen readers generally announced only the first column.Accessibility Insights:
BeforeFix.mp4
NVDA:

Narrator:

After
GridPattern.GetItem(row, column)returns the correct cell accessible object. Screen readers can read all columns in a Details-view ListView.Accessibility Insights:
AfterFix.mp4
NVDA:

Narrator:

Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow