winforms icon indicating copy to clipboard operation
winforms copied to clipboard

[Accessibility] Change DataGridView's Row/Column counting with starting at 1, not 0

Open Olina-Zhang opened this issue 2 years ago • 7 comments

.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: image

Inspect: image

Narrator: image

Steps to reproduce

Repro steps:

  1. Open attached application DataGridView_Sample.zip
  2. Build and run
  3. Use Accessibility tools: AccessiblityInsight, Narrator, Inspect focus on the first DataGridView cell, to observe the rows/columns starting count

Olina-Zhang avatar May 09 '22 06:05 Olina-Zhang

+1 on this issue!

tinodo avatar May 12 '22 06:05 tinodo

This would be breaking change unless just tweaking accessibility string.

dreddy-work avatar May 12 '22 22:05 dreddy-work

@vladimir-krestov , can you guys take a look and see if we can fix this just for accessibility?

dreddy-work avatar May 12 '22 22:05 dreddy-work

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.

merriemcgaw avatar May 17 '22 22:05 merriemcgaw

It's easy to change-just add +1 to index:

DataGridViewRowAccessibleObject.Name: image

And DataGridViewCellAccessibleObject.Row/Column: image


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?

vladimir-krestov avatar May 27 '22 11:05 vladimir-krestov

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.

merriemcgaw avatar Jun 14 '22 17:06 merriemcgaw

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 avatar Aug 01 '22 18:08 merriemcgaw

@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.

Tanya-Solyanik avatar Jul 31 '23 20:07 Tanya-Solyanik

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.

merriemcgaw avatar Jul 31 '23 21:07 merriemcgaw

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?

tinodo avatar Aug 01 '23 06:08 tinodo

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

Tanya-Solyanik avatar Aug 01 '23 23:08 Tanya-Solyanik

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: image Inspect: image Narrator: image

Philip-Wang01 avatar Dec 01 '23 05:12 Philip-Wang01