Skip to content

Fix ListView Details view cell retrieval and full-row accessibility - #15056

Open
LeafShi1 wants to merge 2 commits into
dotnet:mainfrom
LeafShi1:Fix_15044_GetItem_of_ListView_return_null
Open

Fix ListView Details view cell retrieval and full-row accessibility#15056
LeafShi1 wants to merge 2 commits into
dotnet:mainfrom
LeafShi1:Fix_15044_GetItem_of_ListView_return_null

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Sep 8, 2026

Copy link
Copy Markdown
Member

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

  • Implement GridPattern.GetItem(row, column) for ListView in Details view so it returns the correct cell accessible object.
  • For full-row selection, expose all column values through the row accessible name.

Customer Impact

  • JAWS, NVDA, Narrator, and other UIA clients can correctly read and navigate every column in Details-mode ListViews.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

GridPattern.GetItem() returned an empty provider. Screen readers generally announced only the first column.

Accessibility Insights:

BeforeFix.mp4

NVDA:
NVDA_beforeChange

Narrator:
Narrator_beforeChanges

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:
NVDA_AfterChange

Narrator:
Narrator_AfterChang

Test methodology

  • Unit test and manual test

Test environment(s)

  • .net 11.0.0-beta.26453.118
Microsoft Reviewers: Open in CodeFlow

@LeafShi1
LeafShi1 requested a review from a team as a code owner September 8, 2026 07:05
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.24166%. Comparing base (f0cd8e4) to head (4d90214).
⚠️ Report is 6 commits behind head on main.

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           
Flag Coverage Δ
Debug 37.24166% <ø> (ø)
production 39.36526% <ø> (ø)
test 20.64923% <ø> (ø)
unit 39.36526% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 Name for FullRowSelect to 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Details-mode ListView advertises GridPattern but GetItem(row, column) returns empty elements, so JAWS, NVDA and Narrator read only the first column

2 participants