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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:52:59+00:00 2026-05-27T07:52:59+00:00

Is it possible to bind a control’s TabIndex to the column’s order in a

  • 0

Is it possible to bind a control’s TabIndex to the column’s order in a GridView? Say, we have a GridView with AllowsColumnReorder set to true, and when we dragging a second column to be last, the tab navigation order would remain column-ordered: 1 -> 3 -> 2, and not the 1-> 2 -> 3 as usually. What i want to do is the tab navigation according to real column layout as on second image.
before moving column after moving column

My code for kxaml:

   <Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <Grid>
      <ListView ItemsSource="2"
                Grid.Row="1">
                <ListView.View>
                    <GridView AllowsColumnReorder="True">
                        <GridViewColumn Header="One">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Width="100" Text="1"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Two">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Width="100" Text="2"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Three">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox Width="100" Text="3"/>                             
                               </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
      </Grid>
    </Page>
  • 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-27T07:52:59+00:00Added an answer on May 27, 2026 at 7:52 am

    here is an example with datagrid instead

    <DataGrid ItemsSource="2" Grid.Row="1">
      <DataGrid.CellStyle>
        <Style TargetType="{x:Type DataGridCell}">
          <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
        </Style>
      </DataGrid.CellStyle>
      <DataGrid.Columns>
        <DataGridTemplateColumn Header="One">
          <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
              <TextBox Width="100" Text="1" />
            </DataTemplate>
          </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Two">
          <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
              <TextBox Width="100" Text="2" />
            </DataTemplate>
          </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
        <DataGridTemplateColumn Header="Three">
          <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
              <TextBox Width="100" Text="3" />
            </DataTemplate>
          </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>
      </DataGrid.Columns>
    </DataGrid>
    

    EDIT

    here is a solution with listview that works, but i think its not the best…

    public class CustomGridViewColumn : GridViewColumn
    {
      public static readonly DependencyProperty ColumnIndexProperty =
        DependencyProperty.Register("ColumnIndex", typeof(int), typeof(CustomGridViewColumn),
                                    new FrameworkPropertyMetadata());
    
      public int ColumnIndex {
        get { return (int)GetValue(ColumnIndexProperty); }
        set { SetValue(ColumnIndexProperty, value); }
      }
    }
    
    public partial class Window1 : Window
    {
      public Window1()
      {
        InitializeComponent();
        gridView.Columns.CollectionChanged+= new NotifyCollectionChangedEventHandler(gridView_Columns_CollectionChanged);
      }
    
      void gridView_Columns_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
      {
        var index = 0;
        foreach(CustomGridViewColumn col in gridView.Columns){
          col.ColumnIndex=index++;
        }
      }
    }
    
    <ListView KeyboardNavigation.TabNavigation="Cycle">
      <ListView.View>
        <GridView x:Name="gridView" AllowsColumnReorder="True">
          <local:CustomGridViewColumn Header="One" x:Name="col1">
            <local:CustomGridViewColumn.CellTemplate>
              <DataTemplate>
                <TextBox Width="100" Text="1" TabIndex="{Binding Path=ColumnIndex, Mode=OneWay, ElementName=col1}"/>
              </DataTemplate>
            </local:CustomGridViewColumn.CellTemplate>
          </local:CustomGridViewColumn>
          <local:CustomGridViewColumn Header="Two" x:Name="col2">
            <local:CustomGridViewColumn.CellTemplate>
              <DataTemplate>
                <TextBox Width="100" Text="2" TabIndex="{Binding Path=ColumnIndex, Mode=OneWay, ElementName=col2}"/>
              </DataTemplate>
            </local:CustomGridViewColumn.CellTemplate>
          </local:CustomGridViewColumn>
          <local:CustomGridViewColumn Header="Three" x:Name="col3">
            <local:CustomGridViewColumn.CellTemplate>
              <DataTemplate>
                <TextBox Width="100" Text="3" TabIndex="{Binding Path=ColumnIndex, Mode=OneWay, ElementName=col3}"/>
              </DataTemplate>
            </local:CustomGridViewColumn.CellTemplate>
          </local:CustomGridViewColumn>
        </GridView>
      </ListView.View>
    
      <ListViewItem>1</ListViewItem>
      <ListViewItem>2</ListViewItem>
      <ListViewItem>3</ListViewItem>
    </ListView>
    

    hope this helps

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

Sidebar

Related Questions

I have 3 wpf control name A B C. I want to bind C
Is it possible to map one column twice using NHibernate? <property name=CustomerID index=IX_Customer not-null=true
Regarding ASP.NET's GridView server control: Can I bind to a datasource in the code-behind,
Is it possible to bind something to a property of a control in a
I have a asp:ListView control that I bind with a List<CustomObject> . When Editing
Is it possible to bind the multiple commands to the button. I have a
Is it possible to bind a property (don't know which) of the mx:Image control,
I have a ListView control in Asp.Net WebForms which display a set of elements,
Is it possible to bind a WPF combobox control to an OData source and
We have a collection of items we bind to a treeview control. Is it

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.