title: c# WPF determine if DataGrid default visual validation has errors
body: <p>I am a newbie in WPF, I have always done validation for various UI controls using custom ValidationRule classes, however, when using DataGrid for the first time and binding it with a simple DataTable, I found that the DataGrid has a pretty good default validation that detects the type of DataTable columns and gives a visual error if a cell value is not of the same expected type. This is pretty enough for me that I thought no need to create custom validation rules as the default one is fitting my purpose. However, I have a Submit button that I need to disable if this DataGrid has any errors, so I thought that this would be easy utilizing the Validation.HasError property using the following code:</p>
  
  <pre><code>&lt;Button x:Name="btnSubmit" Content="Submit"&gt;
          &lt;Button.Style&gt;
              &lt;Style TargetType="Button"&gt;
                  &lt;Setter Property="IsEnabled" Value="False"/&gt;
                  &lt;Style.Triggers&gt;
                      &lt;MultiDataTrigger&gt;
                          &lt;MultiDataTrigger.Conditions&gt;
                              &lt;Condition Binding="{Binding Path=(Validation.HasError),ElementName=dataGrid}" Value="False"/&gt;
                          &lt;/MultiDataTrigger.Conditions&gt;
                          &lt;Setter Property="IsEnabled" Value="True"/&gt;
                      &lt;/MultiDataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/Button.Style&gt;
      &lt;/Button&gt;
  </code></pre>
  
  <p>But unfortunately, it seems that Validation.HasError is always False whatever the value I enter in the datagrid cells in Runtime. The default visual validation is working properly, the cell gets a red border when an incorrect value is entered, however, no notification is sent that there is an error coming from the dataGrid. </p>
  
  <p>Is there any way to detect within XAML that the default visual validation of the dataGrid is producing an error? or do I have to use a custom validation rule for this purpose?</p>