title: Changing the value type/value of a cell in DataGridView c#
body: <p>I am populating the DataGridView through <code>DataGridView.DataSource</code> where the source is an SQL Server database table. The database table however has columns of different types. Although most of the data in the table is of type <code>INT</code> or <code>VARCHAR</code>, there are a few <code>BIT</code> and <code>IMAGE</code> type columns.</p>
  
  <p>The problem I have has to do with what gets automatically shown in the DataGridView. Although the data in most columns get converted to <code>Strings</code> and is shown as such, the <code>BIT</code> and <code>IMAGE</code> type columns do not. The <code>IMAGE</code> type columns show the image (this is fine with me, I want it to do this) while the <code>BIT</code> type columns show CheckBoxes (<strong>I don't want this</strong>, I want the data to be shown as a <code>String</code>).</p>
  
  <p>I wish to do some formatting after loading the data and change the cells that have CheckBoxes to cells that have <code>Strings</code>. However I don't seem to find a way to do it.</p>
  
  <p>I have tried changing the value through the following: (Please note that prior to the code below being called, <code>cell</code> has previously been filtered as a CheckBox cell.)</p>
  
  <pre><code>if (Convert.ToBoolean(cell.Value))
  {
      cell.Value = "Yes";
  }
  else
  {
      cell.Value = "No";
  }
  </code></pre>
  
  <p>I have also attempted to change the cell type prior to changing its value as shown below. </p>
  
  <pre><code>String dummyString;
  if (Convert.ToBoolean(cell.Value))
  {
      dummyString = "Yes";
  }
  else
  {
      dummyString = "No";
  }
  cell.ValueType = typeof(String);
  cell.Value = dummyString;
  </code></pre>
  
  <p>Unfortunately this has also failed to produce the results I desire. Both attempts don't do anything to the DataGridView that I can see and still display CheckBoxes in the cells instead of Strings.</p>
  
  <p>What am I doing wrong?</p>