title: Make Gridview display checkboxes instead of 0s and 1s
body: <p>I have a <code>GridView</code> that displays records that are either the number 1 or 0.</p>
  
  <p>How can I convert the record into a check box which is checked if the value is 1 or unchecked if the value is 0?</p>
  
  <pre><code>&lt;asp:GridView ID="gvStations" runat="server"&gt;
      &lt;columns&gt;
          &lt;asp:templatefield headertext="Type" sortexpression="TypeDesc"&gt;
              &lt;edititemtemplate&gt;
                  &lt;asp:CheckBox ID="cbTypeEdit" runat="server" Text='&lt;%# Bind("TypeDesc") /&gt;
              &lt;/edititemtemplate&gt;
              &lt;itemtemplate&gt;
                  &lt;asp:CheckBox ID="cbType" runat="server" Text='&lt;%# Bind("TypeDesc") &gt;&lt;/asp:CheckBox&gt;
              &lt;/itemtemplate&gt;
              &lt;itemstyle horizontalalign="Center" /&gt;
          &lt;/asp:templatefield&gt;
          &lt;asp:templatefield headertext="Type 2" sortexpression="TypeDesc2"&gt;
              &lt;edititemtemplate&gt;
                  &lt;asp:CheckBox ID="cbType2Edit" runat="server" Text='&lt;%# Bind("TypeDesc2") /&gt;
              &lt;/edititemtemplate&gt;
              &lt;itemtemplate&gt;
                  &lt;asp:CheckBox ID="cbType2" runat="server" Text='&lt;%# Bind("TypeDesc2") &gt;&lt;/asp:CheckBox&gt;
              &lt;/itemtemplate&gt;
              &lt;itemstyle horizontalalign="Center" /&gt;
          &lt;/asp:templatefield&gt;
      &lt;/columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Right now I can change them to an X if its a 1 and a "blank" if its a 0.</p>
  
  <pre><code>protected void gvStations_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      for (int i = 0; i &lt;= this.gvStations.Rows.Count - 1; i++)//from here down changes the 1's to X's and O's to blanks.
      {
          for (int j = 0; j &lt;= this.gvStations.Columns.Count - 1; j++)
          {
              if (j != 1 &amp;&amp; j != 2)
              {
                  if (this.gvStations.Rows[i].Cells[j].Text == "1")
                  {
                      this.gvStations.Rows[i].Cells[j].Text = "X";
                  }
                  else if (this.gvStations.Rows[i].Cells[j].Text == "0")
                  {
                      this.gvStations.Rows[i].Cells[j].Text = " ";
                  }
              }
          }
      }
  }
  </code></pre>