Disable selecting in WPF DataGrid

Posted by svick on Stack Overflow See other posts from Stack Overflow or by svick
Published on 2010-03-23T00:49:18Z Indexed on 2010/03/23 0:51 UTC
Read the original article Hit count: 1032

Filed under:
|
|
|

How can I disable selecting in a WPFTooklit's DataGrid? I tried modifying the solution that works for ListView (from http://stackoverflow.com/questions/1051215/wpf-listview-turn-off-selection#comment-863179), but that doesn't work:

<tk:DataGrid>
    <tk:DataGrid.ItemContainerStyle>
        <Style TargetType="{x:Type tk:DataGridRow}">
            <Setter Property="Focusable" Value="false"/>
        </Style>
    </tk:DataGrid.ItemContainerStyle>
    <tk:DataGrid.CellStyle>
        <Style TargetType="{x:Type tk:DataGridCell}">
            <Setter Property="Focusable" Value="false"/>
        </Style>
    </tk:DataGrid.CellStyle>
</tk:DataGrid>

© Stack Overflow or respective owner

Related posts about wpf

Related posts about datagrid