title: How to access DataGridView column names safely?
body: <p>When manipulating DataGridView cells, you typically do:</p>
  
  <pre><code>MyGrid.CurrentRow.Cells["EmployeeFirstName"].Value = "John";
  </code></pre>
  
  <p>which is all fine and dandy, but as complexity rises, you start worrying about spelling errors, refactoring issues etc. </p>
  
  <p>Historically, I just made the columns public so I could access them directly in the class instance, but I then have to fight the Windows Forms designer which wants to keep them private (supposedly because it's good practice).</p>
  
  <p>My current solution is to have a class called Cols, with a bunch of strings:</p>
  
  <pre><code>public static class Cols
  {
      public static string EmployeeFirstName = "EmployeeFirstName";
      ...
  }
  </code></pre>
  
  <p>Which results in this:</p>
  
  <pre><code>MyGrid.CurrentRow.Cells[Cols.EmployeeFirstName].Value = "John";
  </code></pre>
  
  <p>This gives me some IntelliSense goodness as opposed to waiting for a runtime error. It still seems vaguely hack-ish, though.</p>
  
  <p>Is there an even more convenient way to do this?</p>