title: C# red cross in datagridview
body: <p>i am using c# and when i try to fill my datagridView most of the time a big red cross apears.</p>
  
  <p>i searched for this and people say that you have to add</p>
  
  <pre><code>public class SafeDataGridView : DataGridView
  {
     protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
     {
        try
        {
          base.OnPaint(e);
        }
        catch (Exception)
        {
          this.Invalidate();
        }
     }
  }
  </code></pre>
  
  <p>i tried to just add this in a simple class file but that did not do anything.</p>