title: Disable row selecting in DataGrid WPF
body: <p>I want to disable DataRow selection in WPF DataGrid.</p>
  
  <p>First I have tried <code>IsHitTestVisible</code> property, it disables whole row. If I want to put an <code>HyperLink</code> it will be disabled.</p>
  
  <p>I have tried to get rid of it by overriding <code>DataGridRow</code> <code>ControlTemplate</code>'s :</p>
  
  <p>(Whole template code is huge but i just put the important section)</p>
  
  <pre><code> &lt;VisualState x:Name="Normal_Selected"&gt;
       &lt;Storyboard&gt;
           &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="DGR_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&gt;
               &lt;EasingColorKeyFrame KeyTime="0" Value="{StaticResource ControlMediumColor}" /&gt;
           &lt;/ColorAnimationUsingKeyFrames&gt;
           &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="DGR_Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"&gt;
               &lt;EasingColorKeyFrame KeyTime="0" Value="{StaticResource ControlDarkColor}" /&gt;
           &lt;/ColorAnimationUsingKeyFrames&gt;
           &lt;!--&lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)"&gt;
               &lt;EasingColorKeyFrame KeyTime="0" Value="Black" /&gt;
           &lt;/ColorAnimationUsingKeyFrames&gt;--&gt;
       &lt;/Storyboard&gt;
   &lt;/VisualState&gt;
  </code></pre>
  
  <p>Actually selecting a row in DataGrid will change <code>Forground</code> color. I have tried <code>Triggers</code> but it won't work. In the code above, I have tried to keep foreground <code>Black</code> but it throws in a run-time error. </p>
  
  <p>How can i disable Row selection in a DataGrid ?</p>