title: Set Color Select entire row of a DataGrid, and MouseOver Behaviour after Changing Background Color
body: <p>My question is about a DataGrid inside a Page Form, programming with C#.NET 4.0. The application is for desktop, not web or Silverlight.</p>
  
  <p>I've made a change into a DataGrid of our page, than changes background. Unfortunately, when i select a row, it only changes to blue (color which identifies is selected) only affect the columns of that row. Inside some of these datagrids, i have some space left. What I need to do, is to select that row entirely, including that blank space.</p>
  
  <p>Another thing which have changed, is a Mouse Behaviour when Mouse is over any record. After this change, now this behaviour doesn't happen anymore.</p>
  
  <p>Any clue what I need to do?</p>
  
  <p><strong>Edit:</strong> Adding code:</p>
  
  <p>My Converter:</p>
  
  <pre><code>public class RetornaCorFundoGrid : DependencyObject, IValueConverter
  {
      public static DependencyProperty CorFundoGridParameterProperty =
          DependencyProperty.Register("CorFundoGridParameter", typeof(IEnumerable&lt;Object&gt;), typeof(RetornaCorFundoGrid));
  
      public IEnumerable&lt;Object&gt; CorFundoGridParameter
      {
          get { return ((IEnumerable&lt;Object&gt;)GetValue(CorFundoGridParameterProperty)); }
          set { SetValue(CorFundoGridParameterProperty, value); }
      }
  
      public object Convert(Object value, Type targetType, object parameter, CultureInfo culture)
      {
          try
          {
              if (System.Convert.ToInt16(value) &lt; 5)
                  return Brushes.BlueViolet;
              if (System.Convert.ToInt16(value) &lt; 15)
                  return Brushes.CadetBlue;
              else
                  return Brushes.Coral;
          }
          catch (Exception)
          {
              return Brushes.Black;
          }
  
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>My Binding Reflector:</p>
  
  <pre><code>&lt;ut:BindingReflector Target="{Binding Mode=OneWayToSource, Source = {StaticResource RetornaCorFundoGrid}, Path=CorFundoGridParameter}" 
                           Source="{Binding Parameters, Mode=OneWay}" /&gt;
  </code></pre>
  
  <p>My Row Style:</p>
  
  <pre><code>&lt;DataGrid.RowStyle&gt;
      &lt;Style TargetType="{x:Type DataGridRow}"&gt;
          &lt;Setter Property="Background" Value="{Binding Path=Id, Converter={StaticResource RetornaCorFundoGrid}}"/&gt;
      &lt;/Style&gt;
  &lt;/DataGrid.RowStyle&gt;
  </code></pre>