title: DataError Dialog Box
body: <p>I am getting a datagridview default error dialog box. There it said handle the dataerror event.
  I am loading the data in myy DGV from a datatable. When I try to add a new row, I click on the empty row with a (*). When I start typing some values in the new row cell, then the dataerror is shown and goes in a infinte loop.</p>
  
  <pre><code>DataGridViewDataError.context = display. 
  Error: Index 3 does not have a value. 
  </code></pre>
  
  <p>My grid has 3rows and here the new row will have index 3. </p>
  
  <p>Here's the code where the DGV is loaded</p>
  
  <pre><code> private void frmPlant_Load(object sender, EventArgs e)
      {
          Program.fMain = this;
          Program.LoadAllForms();
          string selectCommand = "select * from T1";
          FillData(selectCommand);
  
      }
      private void FillData(string selectCommand)
      {
          using (SQLiteConnection conn = new SQLiteConnection(connString))
          {
              conn.Open();
              dataGridView1.AutoGenerateColumns = true;
  
              da = new SQLiteDataAdapter("selectCommand", connString);
              ds = new DataSet();
  
              commandBuilder = new SQLiteCommandBuilder(da);
  
              da.Fill(ds, "T1");
              dt = ds.Tables[0];
              dataGridView1.DataSource = ds.Tables[0];
              dataGridView1.DataMember = "T1";
              dataGridView1.Columns["TID"].ReadOnly = true;
          }
  
      }
  </code></pre>
  
  <p>I don't know where exactly in the code this is happening. Handled the DataError event. Not sure if UserAddedRows, RowsValidating would be useful</p>
  
  <pre><code>private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
          {
              MessageBox.Show(e.Context.ToString());
              e.Cancel = true;
          }
  </code></pre>
  
  <p>Thank you
  Sun</p>