Skip tabs for specific columns
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Skip tabs for specific columns

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    12

    Skip tabs for specific columns

    I have 5 columns towards the end of the code named DataGridTextColumn and I'd like to skip them when the user clicks tab. Is there an easy way to do this, I've tried with KeyboardNavigation.IsTabStop="False" but that did not make a difference.

    Code:
                <dg:DataGrid.Columns>
                    <!--CellStyle="{StaticResource MyCellStyle}"-->
                    <dg:DataGridTextColumn  IsReadOnly="True"  Header="" Binding="{Binding Path=TimeID}" Visibility="Hidden"    />
                    <dg:DataGridTextColumn  KeyboardNavigation.IsTabStop="False" IsReadOnly="True" Header="Route Priority" Binding="{Binding Path=RoutePriority}" MinWidth="100" />
                    <dg:DataGridTextColumn KeyboardNavigation.IsTabStop="False" IsReadOnly="True" Header="Job Address" Binding="{Binding Path=JobAddress}" MinWidth="100" />
                    <dg:DataGridTextColumn KeyboardNavigation.IsTabStop="False" IsReadOnly="True" Header="Permit #"  Binding="{Binding Path=PermitNumber}" MinWidth="100" />
                    <dg:DataGridTextColumn KeyboardNavigation.IsTabStop="False" IsReadOnly="True" Header="Inspection Type"  Binding="{Binding Path=TimeOptionEntry}" MinWidth="100" />
                    <dg:DataGridTextColumn KeyboardNavigation.IsTabStop="False" IsReadOnly="True" Header="Start Time"  Binding="{Binding Path=StartTime}" MinWidth="100" />
                    <dg:DataGridTextColumn KeyboardNavigation.IsTabStop="true" IsReadOnly="True" Header="End Time"  Binding="{Binding Path=EndTime}" MinWidth="100" />
                    <dg:DataGridTemplateColumn Header="" Visibility="Visible" MinWidth="50" MaxWidth="50" x:Name="SelectedGridItem">
                        <dg:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Content="Delete" KeyboardNavigation.IsTabStop="False" Foreground="Black" FontSize="12" VerticalAlignment="Center" MaxWidth="50"
                                         Click="VoidButton_Click" Tag="jobid" Uid="{Binding Path=TimeID}"  Visibility="Visible" />
    Last edited by gstercken; April 23rd, 2009 at 07:02 AM. Reason: Added code tags

  2. #2
    Join Date
    Jan 2009
    Posts
    36

    Re: Skip tabs for specific columns

    You need to set the IsTabStop property on the individual DataGridCell items, which you can do by setting the DataGridTextColumn.CellStyle. Something like the following should work:

    Code:
    <dg:DataGridTextColumn  IsReadOnly="True" Header="Route Priority" Binding="{Binding Path=RoutePriority}" MinWidth="100">
       <dg:DataGridTextColumn.CellStyle>
          <Style TargetType={x:Type dg:DataGridCell}">
             <Setter Property="IsTabStop" Value="False" />
          </Style>
       </dg:DataGridTextColumn.CellStyle>
    </dg:DataGridTextColumn>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center