winforms
winforms copied to clipboard
[Accessibility] Change DataGridView's Row/Column counting with starting at 1, not 0
.NET version
.Net 7.0 SDK build: 7.0.100-preview.5.22256.2
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No, this is not a regression issue. And @merriemcgaw wants a runtime issue to ask to change the counting with starting at 1.
Issue description
We need to change DataGridView's Row/Column counting with starting at 1, not 0
Accessibility Insight:
Inspect:
Narrator:
Steps to reproduce
Repro steps:
- Open attached application DataGridView_Sample.zip
- Build and run
- Use Accessibility tools: AccessiblityInsight, Narrator, Inspect focus on the first DataGridView cell, to observe the rows/columns starting count
+1 on this issue!
This would be breaking change unless just tweaking accessibility string.
@vladimir-krestov , can you guys take a look and see if we can fix this just for accessibility?
We would likely have to make some sort of configuration option for the developer to opt in to counting starting from 1 rather than zero. I can't see any other way to not break our users who have worked around this issue for years. I imagine there's lots of automation that depends on this bug, and probably some AT has worked around this too and we don't want to break either scenario.
It's easy to change-just add +1 to index:
DataGridViewRowAccessibleObject.Name
:
And DataGridViewCellAccessibleObject.Row/Column
:
But we need to decide, how to turn on/off our change. My first proposal is to use something like EnableVisualStyles
method for Application
.
Thoughts?
We would definitely need to quirk this so that those who depend on the "starts at 0" behavior are not broken. @dreddy-work is working on a quirking strategy for the HDPI scary changes, and I think for this one we'd need to follow that same pattern. Let's hold off on this for a little while, so that we can consider how people and assistive tech can use the new behavior. It's not an urgent issue by any means.
This is a major change in behavior and will need to be behind a quirk of some kind. I don't think we can get this in 7, so let's shoot for 8.
@merriemcgaw - had anyone requested this change? This is breaking from .NET Framework and the first column/row is indexed as a zero in the code.
The accessibility team asked us to consider it. I think it is more of a usability rather than accessibility item and I think fixing it may cause problems with screen readers. That said, it is really illogical to a lot of users.
We're not asking to start numbering columns and rows from 1 in CODE, but merely how these columns and rows are ANNOUNCED to users through screen readers. Could we please stop moving this thing from one .NET version to another and either do it or decide not to do it?
Please put this change under a switch. Sample implementation is here - https://github.com/dotnet/winforms/blob/c0ac1f1723e6cd67563d0c979842ae3c1609fd44/src/Common/src/LocalAppContextSwitches.Common.cs#L12
Verified the issue on 9.0.100-alpha.1.23580.4 with dlls build form main branch, the issue has been fixed that the DataGridView's Row/Column counting with starting at 1, not 0.
Accessibility Insight:
Inspect:
Narrator: