Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGridView sends unnecessary event to screen readers on every cell change. #12867

Open
TheQuinbox opened this issue Jan 31, 2025 · 6 comments
Assignees
Labels
tenet-accessibility MAS violation, UIA issue; problems with accessibility standards waiting-author-feedback The team requires more information from the author

Comments

@TheQuinbox
Copy link

.NET version

9.1.00

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

I have this simple Windows Forms app using DataGridView. Every time I press an arrow key to move to a different cell, using either NVDA or Narrator, after reading all of the correct information about the cell, the screen reader will say "edit", for seemingly no reason.

public class Form1 : Form {
	private DataGridView gridView;

	public Form1() {
		Text = "Periodic Table";
		ClientSize = new Size(1000, 600);
		gridView = new DataGridView {
			AllowUserToAddRows = false,
			AllowUserToDeleteRows = false,
			AllowUserToOrderColumns = false,
			AllowUserToResizeColumns = false,
			AllowUserToResizeRows = false,
			ColumnCount = 18,
			RowCount = 11,
			Dock = DockStyle.Fill,
			ReadOnly = true,
			RowHeadersVisible = true,
			ColumnHeadersVisible = true
		};
		Controls.Add(gridView);
	}

	[STAThread]
	public static void Main() {
		ApplicationConfiguration.Initialize();
		Application.Run(new Form1());
	}
}

Steps to reproduce

  1. Run the demo app from above with a screen reader active.
  2. Press the arrow keys to move around the grid.
@TheQuinbox TheQuinbox added the untriaged The team needs to look at this issue in the next triage label Jan 31, 2025
@elachlan elachlan added the tenet-accessibility MAS violation, UIA issue; problems with accessibility standards label Feb 1, 2025
@Zheng-Li01
Copy link
Member

@TheQuinbox , this is not a real issue. for now, the keyboard tooltip is supported for the controls by default, so the Edit tooltip will be announced when using the arrow keys got though the cells as below screenshot. So you can disable the tooltip such as below code section.
ShowCellToolTips = false

Image

@TheQuinbox
Copy link
Author

Hi @Zheng-Li01,
You are indeed correct, adding this removed the unnecessary event being fired. What exactly is the purpose of it, though? As a screen reader user myself, I don't expect to hear "edit" when navigating around a grid that doesn't actually have any editable content in it.
Thanks!

@Zheng-Li01
Copy link
Member

@TheQuinbox, thanks for your response. as below screenshot, sometimes the screen reader user wants to know which type of cell was used for now, who can get the cell's type info by using screen reader to announce the tooltip.
Image
Image

@TheQuinbox
Copy link
Author

Hi @Zheng-Li01,
this is exactly my point. Sorry, I should've been clearer. My DataGridView is set to read-only. Why, then, is the tool tip "edit", even though the user is unable to edit any content, and furthermore, they can't even navigate the cells like edit fields because the arrow keys move around the grid.
Thanks,
Quin.

@LeafShi1
Copy link
Member

@TheQuinbox @Tanya-Solyanik Referring to the display of the Textbox control, when the Textbox is read-only, adding the ReadOnly attribute to it, do you think this is reasonable?

Image

Image

@LeafShi1 LeafShi1 self-assigned this Feb 11, 2025
@merriemcgaw merriemcgaw added waiting-author-feedback The team requires more information from the author and removed untriaged The team needs to look at this issue in the next triage labels Feb 12, 2025
@LeafShi1
Copy link
Member

The tooltips of all controls will be read out automatically, which is controlled by the AnnounceText method of Tooltip itself

The reason why DataGridViewCell displays Tooltip is that the GetDefaultToolTipText method is overridden in DataGridViewTextBoxCell

@Tanya-Solyanik @TheQuinbox There are currently two solutions below. Which one do you think is more reasonable?

Solution1: we can disable the Tooltip of DataGridViewCell, so that no extra text will be read out.
The following is the pronunciation result of NVDA after disabling the ToolTip of DataGridViewTextBoxCell

Image

Solution 2: when the Textbox is read-only, adding the ReadOnly attribute to it's ToolTip

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tenet-accessibility MAS violation, UIA issue; problems with accessibility standards waiting-author-feedback The team requires more information from the author
Projects
None yet
Development

No branches or pull requests

5 participants