Populate empty DataGrid Quantity per Unit column#797
Open
amarinov-msft wants to merge 1 commit into
Open
Conversation
The DataGrid sample never assigned Product.QuantityPerUnit, so every cell in that column was empty. For an empty DataGrid cell, WPF's DataGridCellItemAutomationPeer falls back to a name built from the row object's ToString() (the Product type name) plus the column index, so Narrator announced 'Item: WPFGallery.Models.Product, Column Display Index: N' instead of an empty value. Populate QuantityPerUnit with numeric values so the column has meaningful data; Narrator now reads the actual cell value (MAS 1.3.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes an accessibility issue on the WPF Gallery Collections DataGrid page. The Quantity per Unit column is completely empty, and when focus lands on one of its cells Narrator announces meaningless internal information instead of an empty value - flagged under MAS 1.3.1 - Info and Relationships and Trap 1.4 - Uncomprehended Element.
Change
Sample Applications/WPFGallery/ViewModels/Collections/DataGridPageViewModel.csPopulated
QuantityPerUnitwith realistic values, assigned randomly using the same generation pattern already used for the other product fields. The column now contains meaningful data, so no cell is empty.Result
Focusing a Quantity per Unit cell now announces the actual cell value instead of the internal type-name fallback string, satisfying MAS 1.3.1. The sample data is also more complete and realistic. No XAML or visual/layout changes.
Testing
• Built WPFGallery.csproj (0 errors).
• Verified with a screen reader that Quantity per Unit cells announce their populated value
Microsoft Reviewers: Open in CodeFlow