Declined
Last Updated: 09 Feb 2024 08:26 by ADMIN
Christian
Created on: 08 Feb 2024 07:18
Category: GridView
Type: Bug Report
3
Inconsistent Cell Focus Behavior in RadGridView Affecting Screen Reader Functionality

Dear Telerik Support Team,

I am encountering an issue with the RadGridView control in my application, which is impacting the usability for users relying on screen readers. Below, I have outlined the details of my development environment, the problem, and attached a sample project demonstrating the issue.

Issue Description:
In the attached sample project, I have implemented a simple RadGridView without any custom styling and populated it with sample data. I have observed that the focus behavior is inconsistent, particularly with the first cell in the RadGridView. When attempting to focus the first cell, only the cell itself receives focus, unlike subsequent cells where both the cell and the entire row are focused. This inconsistency results in screen readers failing to read out the content of the first cell, while they correctly read the contents of all other cells.

Upon further investigation using the Snoop utility to explore the visual tree, I noticed that the GotFocused event for the initially focused cell identifies it as being of type RadGridView, whereas, for other cells, the type is GridViewCell. This discrepancy seems to be at the root of the issue.

Attachments:
I have included a simplified, runnable standalone application that reproduces this behavior. Please find the sample project attached to this ticket.

I believe this might be a bug affecting the accessibility of the application, and I would greatly appreciate your guidance on whether this is a known issue with a workaround or if there's a fix available.

Thank you for your assistance.

Best regards,

 

Christian

First Tab:

Second Tab:

1 comment
ADMIN
Vladimir Stoyanov
Posted on: 09 Feb 2024 08:26

Hello Christian,

I posted a reply in the ticket that you have opened, but I will share it here as well.

What you have observed is the expected behavior. With the first Tab click only the RadGridView receives focus. This happens through the default tab navigation provided by WPF. When the RadGridView receives focus it sets its CurrentCell (which can be observed on the first picture surrounded by a black border), however it does not focus that cell, which is by design. After that on the second click the RadGridView receives a KeyDown event for the Tab key, which triggers its keyboard navigation logic and executes the SelectCurrentUnit and MoveNext commands (which can be observed on the second picture highlighted in yellow). The MoveNext command is the one that focuses the GridViewCell. That is why the 2nd Tab focuses the 2nd cell once the focus is already in the RadGridView. 

That said, you can alter this behavior by subscribing to the GotFocus event of the RadGridView and focusing the CurrentCell. Here is what I have in mind:

 

private void radGridView_GotFocus(object sender, RoutedEventArgs e)
{
    var gridView = sender as RadGridView;

    gridView.CurrentCell.Focus();
}

 

If you would also like for the first item to be selected, you can set the IsSynchronizedWithCurrentItem property of the RadGridView to "True":

<telerik:RadGridView IsSynchronizedWithCurrentItem="True"/>

Alternatively, you can also set the SelectedItem of the RadGridView to its CurrentItem:

private void radGridView_GotFocus(object sender, RoutedEventArgs e)
{
    var gridView = sender as RadGridView;

    gridView.CurrentCell.Focus();
    gridView.SelectedItem = gridView.CurrentItem;
}

Can you give this approach a try and let me know, if it helps?

 

Should you have any additional questions I would ask you to continue the discussion in the support thread to avoid duplicating replies. Thank you in advance for your understanding.

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.