Column go to tab DataGrid

I have a datagrid with template columns in WPF. A couple of columns in the grid are read-only, others in focus become editable (instead of shortcuts, text fields, check boxes, etc.).

What I would like to achieve is that readonly columns are skipped when I iterate over the grid columns.

Does anyone know how to achieve this?

Thanks! Vladan


No, it does not work: (

Here is the full cell ... tried it with KeyboardNavigation.IsTabStop and IsTabStop alone ... didn't work

<DataGridTemplateColumn Header="{x:Static local:MainWindowResources.gasNameLabel}" Width="*" MinWidth="150" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ContentControl Content="{Binding Path=Name}" ContentTemplate="{StaticResource DataGridTextBoxView}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellStyle> <Style TargetType="{x:Type DataGridCell}"> <Style.Triggers> <Trigger Property="IsReadOnly" Value="true"> <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/> </Trigger> </Style.Triggers> </Style> </DataGridTemplateColumn.CellStyle> </DataGridTemplateColumn> 
+6
source share
1 answer

Something like this will work:

 <DataGrid.Resources> <Style TargetType="DataGridCell"> <Style.Triggers> <Trigger Property="IsReadOnly" Value="True"> <Setter Property="IsTabStop" Value="False"/> </Trigger> </Style.Triggers> </Style> </DataGrid.Resources> 
+10
source

Source: https://habr.com/ru/post/898173/


All Articles