title: ASP.NET 2.0 Gridview CheckBox column
body: <p>I have a <code>GridView</code> that displays data on three columns. On the third column I have a <code>CheckBox</code>. I have two things that I need to achieve</p>
  
  <ol>
  <li><code>CheckBox</code> will be checked based on the column value (1,0)</li>
  <li>If it is checked the rest of the two columns should display <code>####</code> However the data for the two columns should remain in the database.</li>
  </ol>
  
  <p>How can this be achieved? </p>
  
  <p>Can I find the <code>CheckBox</code> on <code>RowDataBound</code> event and check the value and make the <code>CheckBox</code> checked and unchecked? How about making the other columns <code>####</code>?</p>
  
  <h1>NEW Comments:</h1>
  
  <pre><code>string str = ((System.Data.DataRowView)(e.Row.DataItem)).Row.ItemArray[2].ToString();
  </code></pre>
  
  <p>this helps to set the checkbox checked or not.</p>
  
  <p>if checked is true I am trying the following.</p>
  
  <pre><code>((System.Data.DataRowView)(e.Row.DataItem)).Row.ItemArray[0] = "#####";
  ((System.Data.DataRowView)(e.Row.DataItem)).Row.ItemArray[1] = "#####";
  ((System.Data.DataRowView)(e.Row.DataItem)).Row.AcceptChanges();
  </code></pre>
  
  <p>It is displaying the gridview checkbox as checked but the column value is not changed to "####"</p>