title: Sorting a DataGridView by Number or Date in a Windows Form C#
body: <p>I have a DataGridView on a C# Forms Application I'm trying to sort.</p>
  
  <p>Originally I wanted to sort by the date, but when sorting it treats it like a string.
  Example:</p>
  
  <p>22/9/2009<br>
  14/4/2008<br>
  3/12/2007</p>
  
  <p>Sorts to</p>
  
  <p>14/4/2008<br>
  22/9/2009<br>
  3/12/2007</p>
  
  <p>Because its only looking at the first character.
  Once I couldnt solve this I tried to sort by an ID column.  Since my data is stored by date anyways I figured I could give them an ID when loading and sort off that, but the same issue occurs.  11 comes before 2 because it starts with a 1 kinds deal.</p>
  
  <p>Any ideas how I can solve this?</p>
  
  <p>Here is my code for reading in the data:</p>
  
  <pre><code>string[] rowArray = new string[] { arService[0], arService[1], arService[2], arService[3], arService[4], arService[5], arService[6] };
  dgvSubmissions.Rows.Add(rowArray);
  </code></pre>
  
  <p>The array is read in from a comma delimited text file and split.</p>
  
  <p>Here's my new code, but it's still providing the same results.  What am I doing wrong now?</p>
  
  <pre><code>  int n = dgvSubmissions.Rows.Add();
    dgvSubmissions.Rows[n].Cells[0].Value = arService[0];
    dgvSubmissions.Rows[n].Cells[1].ValueType = typeof(DateTime);
    dgvSubmissions.Rows[n].Cells[1].Value = arService[1];
    dgvSubmissions.Rows[n].Cells[2].Value = arService[2];
    n++;
  </code></pre>