Skip to content

WPF DataGrid does not focus as expected when targeted by Label with an access key #5662

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


I have a handful of views in which I define Label elements with access keys that target DataGrid elements. I would expect the behavior when I trigger the access key (alt+key or otherwise) is to focus the grid contents, much like what happens when I tab to the grid.

Instead, what I see is that a focus rectangle is drawn on the grid, but the focus is on the grid itself rather than its contents. As a consequence:

  • no cells or rows are highlighted (if they aren't already)
  • arrow keys navigate to adjacent controls rather than navigating around the grid contents
  • text search does not trigger on key press
  • pressing the menu key will successfully bring up the grid's context menu (as expected)

It is not until I hit tab that focus actually enters the grid contents.

Attached is a minimal example project including some Labels targeting DataGrids juxtaposed against a Label targeting a TextBox to highlight the behavior.

[testlabeltargeting.zip] (https://aka.ms/dc/file?name=Bc8bc10974f6b46bd91286df0bd7928a1637522969555395940_testlabeltargeting.zip&tid=c8bc10974f6b46bd91286df0bd7928a1637522969555395940)


Original Comments

Feedback Bot on 3/25/2021, 08:06 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 7/5/2021, 11:35 PM:

I detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions