Search code examples
wpffocusgridpanel

Skip KeyboardNavigation for all Controls in a Panel or Grid in WPF


Normaly KeyboardFocus will be skipped, when the controls IsTabStop property is set to false. But there is no such porperty for the Grid or other Panels. I tried the Attached Property KeybordNavigation.IsTabStop, but this neither had the affect of skipping the Keyboard Focus for the hole grid.

I want to skip all controls within a grid when one of the grid descendant controls will normaly reseive the focus. Has somebody experience with this an can provide an solution?


Solution

  • You were close. On your Grid you need to use the attached property:

    KeyboardNavigation.TabNavigation="None"