[release/8.0] Allows DataGridView to start row/column on index 1 on Narrator
Backport #10243 to release/8.0
Fixes https://github.com/dotnet/winforms/issues/13994
Proposed changes
- Creates a new switch
System.Windows.Forms.DataGridViewUIAStartRowCountAtOnethat allows developers to configure their application to make the starting index of rows/cells in DataGridView to be read by Narrator from 1, instead of 0; - Adds checks on rows and cells of DataGridView to see if the switch is true. If true, starting index of rows/cells will be 1, instead of 0.
Customer Impact
- Developers will be able to configure their WinForms DataGridView rows/cells to be read by Narrator from index 1, instead of 0.
Regression?
- No
Risk
- Low
Test methodology
- Manual testing
- Unit tests
Microsoft Reviewers: Open in CodeFlow
@KlausLoeffelmann @Shyam-Gupta I'd like you two to weigh in before we take this. It was approved by Tactics, but I realized that this adds the switch which enables the starting count at 1 rather than 0. That's a behavior change, but @LeafShi1 can tell us whether this new behavior is enabled by default or not. The SSMA team would still have to update their app to turn on the feature if I'm not mistaken. We could never turn this on by default, and if they can't enable this, then maybe we don't need it in servicing and they can just take it when they get to migrate from 8->10.
@LeafShi1 can tell us whether this new behavior is enabled by default or not.
it's enabled by default https://github.com/dotnet/winforms/blob/09c759bdfe30423022c81cf2264e32547e712c26/src/System.Windows.Forms/System/Windows/Forms/Controls/DataGridView/DataGridViewRow.DataGridViewRowAccessibleObject.cs#L138
So, I am confused with this. @merriemcgaw: I did not see your comment before, when I reviewed this. Now that I am reading this, I am wondering: Why should we continue to consider this for servicing?
I have updated the switch to System.Windows.Forms.DataGridViewUIAStartRowCountAtOne and set it as disabled by default.
@Shyam-Gupta @merriemcgaw Please review it again
We could never turn this on by default, and if they can't enable this, then maybe we don't need it in servicing and they can just take it when they get to migrate from 8->10.
@merriemcgaw Could you please confirm if we need to service this change?
Also, while the change is correct, I am a bit confused why did we choose to flip the switch rather than just setting the default value of DataGridViewUIAStartRowCountAtZero to true ?
Also, while the change is correct, I am a bit confused why did we choose to flip the switch rather than just setting the default value of
DataGridViewUIAStartRowCountAtZeroto true ?
Renaming it to DataGridViewUIAStartRowCountAtOne would make the intent clearer. It allows the logic to read naturally:
private static int RowStartIndex =>
LocalAppContextSwitches.DataGridViewUIAStartRowCountAtOne ? 1 : 0;
As per the discussion with SME Down grading the severity to Sev3. Therefore, we do not need to port the fix to the .NET 8.0 version, and this pull request is being closed.