title: Forcing ErrorText to show in a DataGridView
body: <p>I've Googled and Googled for this already...<br><br>When my application starts, it loads a config file and displays its contents in a DataGridView - including errors found in the config file. </p>
  
  <p>So when my method Main() exits, here are some key values:</p>
  
  <ul>
  <li><code>dgv.Rows[0].Cells[3].ErrorText</code> contains <em>"Only alpha-numeric characters allowed"</em></li>
  <li><code>dgv.Visible</code> is False</li>
  <li><code>dgv.Rows[0].Cells[3].IsInEditMode</code> is False</li>
  </ul>
  
  <p>Here's the pertinent code:</p>
  
  <pre><code>    public Main()
      {
          InitializeComponent();
          dgvStationConfiguration.DataSource = FileReaderWriter.GetStationsFromConfigFile();
          StationConfigurationValidator.ValidateAllCellsAndSetAllErrorMessages(dgvStationConfiguration);
      }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    public static bool ValidateAllCellsAndSetAllErrorMessages(DataGridView dgv)
      {
          bool areAllCellsValid = true;
  
          foreach (DataGridViewRow row in dgv.Rows)
          {
              foreach (DataGridViewCell cell in row.Cells)
              {
                  bool isCellValid = ValidateCellAndSetErrorMessage(cell); // validate all cells in order to set their error text/glyphs; this flag is just to be able to return a summary
  
                  if (isCellValid == false)
                  {
                      areAllCellsValid = false;
                  }
              }
          }
  
          return areAllCellsValid;
      }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    public static bool ValidateCellAndSetErrorMessage(DataGridViewCell cell)
      {
          string columnName = cell.OwningColumn.Name;
          string cellValue = cell.EditedFormattedValue.ToString();
  
          cell.ErrorText = StationConfigurationValidator.GetCellErrorMessage(columnName, cellValue);
          return cell.ErrorText == string.Empty;
      }
  </code></pre>
  
  <p>When the method completes and the user is shown the DataGridView, no red error glyphs are visible. If I click in and then out of that cell (namely [0][3]) - the glyph appears.<br><br>I get the impression that the main problem is that when the ErrorText is set (in method Main) the the DataGridView is still not visible.<br><br>I'm getting so desperate that I'm thinking of this incredible hack: have a timer go off in 10ms (to allow method Main to exit) to set the ErrorText - then disable (unhook) the timer. That's such a hack I can't stand it... Just illustrating my desperation... :-(<br><br><strong>So...</strong> <em>What do I need to do to make that glyph show???</em></p>