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 6695067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:10:37+00:00 2026-05-26T06:10:37+00:00

Why isn’t my XAML following the TabOrder I specified? I currently have: <DockPanel> <Grid

  • 0

Why isn’t my XAML following the TabOrder I specified?

I currently have:

<DockPanel>
    <Grid DockPanel.Dock="Top">
        <UserControl TabIndex="0">
            <StackPanel Orientation="Horizontal">
                <ComboBox />
                <TextBox Text="Search Text" />
                <Button Content="Search" />
            </StackPanel>
        </UserControl>
        <ComboBox TabIndex="1" />
        <Separator />
        <TextBox TabIndex="3" Text="Save" />
        <TextBox TabIndex="4" Text="Cancel" />
    </Grid>
    <Grid>
        <ContentControl TabIndex="2" />
        <Popup />
    </Grid>
</DockPanel>

enter image description here

My TabOrder should go

  • Search ComboBox
  • Search Text
  • Search Button
  • Database ComboBox
  • ContentControl
  • Save Button
  • Cancel Button

But instead it goes

  • Search ComboBox
  • Search Text
  • Search Button
  • ContentControl
  • Database ComboBox
  • Save Button
  • Cancel Button

What do I have wrong with my TabOrder?

Edit

I found this SO answer which suggested making UserControl.IsTabStop="False", and binding it’s Child control’s TabIndex to UserControl.TabIndex, which partially works.

My TabOrder is now

  • Search ComboBox
  • Search Text
  • Search Button
  • Database ComboBox
  • Save Button
  • Cancel Button
  • ContentControl
  • 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-05-26T06:10:38+00:00Added an answer on May 26, 2026 at 6:10 am

    Apparently by default, WPF reads all the controls, inside and outside UserControls, at the same tab level (unless specified otherwise). Since the controls inside the UserControl do not have a TabIndex specified, they get tabbed to last after the first tab cycle.

    The workaround was to bind the TabIndex of the inner controls to the TabIndex of the UserControl

    <DockPanel Margin="10" KeyboardNavigation.TabNavigation="Cycle">
        <Grid DockPanel.Dock="Top"
              local:GridProperties.ColumnCount="6"
              local:GridProperties.StarColumns="0">
    
            <TextBlock Text="Header" FontSize="20" FontWeight="Bold" />
            <ContentControl Grid.Column="1" TabIndex="0" IsTabStop="False" Content="{Binding SearchViewModel}" />
    
            <ComboBox Grid.Column="2" Margin="5" Width="100" />
    
            <Separator Grid.Column="3" Style="{StaticResource VerticalSeparatorStyle}" />
    
            <Button Grid.Column="4" TabIndex="3" Content="Save" Width="75" Margin="5" />
            <Button Grid.Column="5" TabIndex="4" Content="Cancel" Width="75" Margin="5" />
        </Grid>
    
        <Line HorizontalAlignment="Stretch" X2="1" Stretch="Fill" Stroke="Black" StrokeThickness="1" Margin="0,5" DockPanel.Dock="Top" />
    
        <Grid x:Name="ShellContentRoot">
    
            <!-- Current Page -->
            <ContentControl TabIndex="2" Content="{Binding CurrentAccount}" IsTabStop="False" />
    
            <!-- Search Results -->
            <local:PopupPanel local:PopupPanel.PopupParent="{Binding ElementName=ShellContentRoot}" />
        </Grid>
    </DockPanel>
    

    The only thing special about my SearchView is that the controls all set

    TabIndex="{Binding Path=TabIndex, RelativeSource={RelativeSource 
        AncestorType={x:Type local:SearchView}}}"
    

    Tab Order goes:

    • UserControl Search ComboBox
    • UserControl Search Text
    • UserControl Search Button
    • Database ComboBox
    • ContentControl
    • Save Button
    • Cancel Button
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Isn't there some way to re-write the following code, such that I don't need
Isn't every language compiled into low-level computer language? If so, shouldn't all languages have
Isn't it much more elegant and neat to have an IStringable interface? Who needs
isn't it possible to rename tags within the app.config? If I use the following
Isn't UIButton supposed to become grayish/grayer when enabled=NO ? I have a simple UIButton
This isn't working as I'd like. I have an entry form for a new
This isn't something that I expected from the asset pipeline. Let's say I have
Isn't having String enough? Just as an example, why can String class lets you
Isn't it much slower concerning development time ? What are the advantages of of
Isn't there another way of using global variables in a Java stlye manner in

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.