How to make WPF Datagrid Column non-focusable? How to make WPF Datagrid Column non-focusable? wpf wpf

How to make WPF Datagrid Column non-focusable?


Use a cell style and set Focusable=False.

<Page.Resources>    <Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">        <Setter Property="Focusable" Value="False"/>    </Style></Page.Resources><DataGrid ItemsSource="{Binding Items}" ...>    <DataGrid.Columns>        <DataGridTextColumn             CellStyle="{StaticResource CellStyle}"             IsReadOnly="True"             Header="Name" Binding="{Binding Name}"/>    ....