title: Why doesn't the Error Event in my DataSource fire when an error occurs?
body: <p>I'm trying to get my DonutChart to show an error when there is an error in the ModelState. However, the event in the DataSource.Events.Error doesn't get fired. Am I missing something here?</p>
  
  <p>I have a cshtml-file with the chart in it:</p>
  
  <pre><code>@{ string shortDept = "OW"; }
  
  @model IEnumerable&lt;DonutValue&gt;
  @(Html.Kendo().Chart&lt;DonutValue&gt;()
      .Name("Donut")
      .DataSource(dataSource =&gt; dataSource
          .Read(read =&gt; read
              .Action("Get_KPI", "Data", new { dept = shortDept })
          )
          .Events(events =&gt; events
              .Error("checkError")
          )
      )
      .Series(series =&gt; { series
          .Donut(
              model =&gt; model.Value,
              model =&gt; model.Description,
              model =&gt; model.Color,
              null
          )
          .HoleSize(50)
          .Size(16)
          .StartAngle(90);
      })
      .Events(events =&gt; events
          .SeriesHover("onDonutSeriesHover")
          .Render("onDonutRender")
      )
  )
  </code></pre>
  
  <p>The Model is as follows:</p>
  
  <pre class="lang-c prettyprint-override"><code>public class DonutValue
  {
      public string Department { get; set; }
      public decimal Value { get; set; }
      public string Color { get; set; }
      public string Description { get; set; }
  }
  </code></pre>
  
  <p>The Controller works and returns data, with an error in the ModelState:</p>
  
  <pre class="lang-c prettyprint-override"><code>public class DataController : Controller
  {
      [HttpPost]
      public JsonResult Get_KPI([DataSourceRequest] DataSourceRequest request, string dept)
      {
          ModelState.AddModelError("Error", "Testfoutmelding!");
          KPIServicesClient client = new KPIServicesClient();
          List&lt;DonutChartValue&gt; values = client.GetDonutChartValues() ?? new List&lt;DonutChartValue&gt;();
          var data = values.FirstOrDefault(x =&gt; x.Department == dept);
          var data2 = new DonutValue[] {
              new DonutValue() {Value = data.CurrentSLA, Color = data.SLAColor, Description = $"Huidige SLA: {data.SLAShowValue}", Department = dept},
              new DonutValue() {Value = data.PotentialPlusSLA, Color = data.PotentialSLAColor, Description = $"Potentiële SLA: {data.PotentialSLAShowValue}", Department = dept },
              new DonutValue() {Value = data.LostSLA, Color = "#EFEFEF", Description = "", Department = dept}
          };
  
          return Json(data2.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
      }
  }
  </code></pre>
  
  <p>The JavaScript function only shows an alert for testing purposes:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
    function checkError(e) {
      alert("Error!");
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>I verified that the error is actually returned in the JSON result: 
  <a href="https://imgur.com/AFacf99" rel="nofollow noreferrer">https://imgur.com/AFacf99</a>.</p>
  
  <p>The JavaScript code for handling the error is in the same file as the code for handling the Render and SeriesHover, and they get fired, so the script can be reached.</p>
  
  <p>Am I missing something here? Please help!</p>
  
  <p>Thanks in advance!</p>