DateTimeEditBox and TabIndex

Editors for WPF Forum

Posted 8 years ago by Joerg Werner
Version: 11.1.0545
Avatar
Hi,
we are using your DateTimeEditBox controls on a form together with textboxes.
All controls will have a TabIndex and IsTabStop is set True.

The resulting tab order is something stupid.
As seen in the example, tabbing around you can't reach the last two textboxes.
<Window x:Class="WpfApplication2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="268" Width="247" xmlns:editors="http://schemas.actiprosoftware.com/winfx/xaml/editors">
    <Grid>
        <TextBox Height="24" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBox1" VerticalAlignment="Top" Width="200" TabIndex="0" />
        <editors:DateTimeEditBox Height="24" HorizontalAlignment="Left" Margin="12,55,0,0" Name="dateTimeEditBox1" VerticalAlignment="Top" Width="200" TabIndex="1" IsTabStop="True" />
        <editors:DateTimeEditBox Height="23" HorizontalAlignment="Left" Margin="12,98,0,0" Name="dateTimeEditBox2" VerticalAlignment="Top" Width="200" TabIndex="2" IsTabStop="True" />
        <TextBox Height="24" HorizontalAlignment="Left" Margin="12,143,0,0" Name="textBox2" VerticalAlignment="Top" Width="200" TabIndex="3" />
        <TextBox Height="24" HorizontalAlignment="Left" Margin="12,189,0,0" Name="textBox3" VerticalAlignment="Top" Width="200" MaxLines="4" TabIndex="4" SnapsToDevicePixels="True" />
    </Grid>
</Window>
Are we doing something wrong?

Thanks.

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Joerg,

If you remove the TabIndex and IsTabStop properties, then you can properly tab through the controls. You don't really need to define the tab order, as their placement in the Grid will determine the order.

You can also set KeyboardNavigation.TabNavigation="Local" on the DateTimeEditBox controls to fix the issue.

The DateTimeEditBox itself isn't really meant to be a tab stop, the elements inside are though.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.