Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:42:17+00:00 2026-06-12T15:42:17+00:00

I have the following Window defined: <Window x:Class=ShortCutInTabControlproblem.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <DockPanel>

  • 0

I have the following Window defined:

<Window x:Class="ShortCutInTabControlproblem.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<DockPanel>

    <TabControl>
        <TabItem Header="_1st Tab">
            <DataGrid ItemsSource="{Binding Persons}" />                
        </TabItem>
        <TabItem Header="_2nd Tab">

        </TabItem>
    </TabControl>
</DockPanel>

With the following code behind:

public partial class MainWindow : Window
{
    public ObservableCollection<Person> Persons { get; set; }

    public MainWindow()
    {
        InitializeComponent();

        Persons = new ObservableCollection<Person>
                    {new Person() {Name = "John", Age = 39}, new Person() {Name = "Doe", Age = 34}};

        DataContext = this;
    }
}

And finally the following “Model”:

public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}

The strangest thing happens when I try to add a row to the datagrid on the first tab (“1st Tab”) and the first key I press is ‘2’. This will activate the second tab (“2nd tab”), as this has a shortcut defined.

If I edit an existing grid, e.g. the age of John and press ‘2’, then nothing happens (except the age is changed to 2).

Is this a known bug and are there any known fixes? Do You know of a way to require Alt+’2′ to be pressed, and not just ‘2’?

Please help me…

Thanks in advance
Søren Rokkedal

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:42:18+00:00Added an answer on June 12, 2026 at 3:42 pm

    It’s actually a know issue that is supposed to be fixed in a future release of .NET.

    In the meantime you can use a custom TabItem to fix your problem :

    public class MyTabItem : TabItem
    {
        protected override void OnAccessKey(AccessKeyEventArgs e)
        {
            if ((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt)
            {
                return;
            }
            base.OnAccessKey(e);
        }
    }
    

    You can also write the following fix to solve the issue for all UIElements :

    EventManager.RegisterClassHandler(typeof(UIElement), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(OnAccessKeyPressed));
    

    where OnAccessKeyPressed would implement the same logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following WPF application <Window x:Class=Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:local=clr-namespace:WpfApplication1 Title=Window1 Height=300 Width=300>
Let's say, for instance, I have the following extremely simple window: <Window x:Class=CalendarGenerator.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
I have the following model defined in .NET: Public Class Request <Key()> Public Property
I have the following window, which displays a listview. I defined a style for
I have created a class-managed GUI in which the following methods are defined function
On Windows using WAMPserver (Apache, MySQL, PHP) I have the following: //test.php if (!defined('LC_MESSAGES'))
I have the following extJs window which has two tabs in it. One of
I have the following code which creates a simple window with two buttons which
I have the following HTML that pops up a window when I click the
I have the following code to create my window, my view and my sub

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.