title: Try to parse a gridview cell value to any type (validation)
body: <p>I'm trying to validate what the user inputs in an editable gridview.
  I use the event CellLeave to validate the input, like this:</p>
  
  <pre><code>private void membersGrid_CellLeave(object sender, DataGridViewCellEventArgs e)
  {
      // Datatable that will hold the schema for the Members table
      DataTable dtMeta;
  
      // SqlDataAdapter is already filled and is now used to get the metadata
      daAllMembers.FillSchema(dtMeta, SchemaType.Source);
  
      // Define a type instance of the current column from the metadata table dtMeta
      System.Type cellType = dtMeta.Columns[e.ColumnIndex].DataType;
  
      // Get an object from the editted cell
      Object objCellValue = membersGrid[e.ColumnIndex, e.RowIndex].Value;
  
      // This is where i'm stuck, how can I do this?
      cellType.TryParse(objCellValue);
  }
  </code></pre>
  
  <p>I hope you understand what I'm trying to do. I basically want to tryparse the object into the type defined in the metadata for that table.</p>
  
  <p>Any help is appreciated ;)</p>