none
How to disable row selection - DataGrid

    Question

  • How can I disable row selection on a datagrid?  I can't seem to find the appropriate property.  Thanks.

    <data:DataGrid x:Name="dgDetails" AutoGenerateColumns="False" IsReadOnly="True" Width="350" Height="200" Grid.Column="0" />

     

     

     

    Friday, September 11, 2009 2:08 PM

Answers

  • angiedawnf,

    You can try the hack - setting the SelectedItem property to Null on the SelectionChanged event - mentioned in this post: http://www.vbforums.com/showthread.php?t=556601. I haven't tried it myself but it looks like the cell still gets selected though.

    The alternative is rather tedious, you will have to use the VisualStateManager and style the row.

    Hope this helps!

    Friday, September 11, 2009 2:25 PM