title: Hide a cell from gridview
body: <p>I have a winform c# SQL app in which i retrieve some values to a datagrid view and from there on wards i will display them to a user.</p>
  
  <p>however there are certain gridcells which have values that i don't want to show to the user, and i want to hide them,</p>
  
  <p>here is my code to hide cell values.</p>
  
  <pre><code>CurrencyManager cm =   (CurrencyManager)BindingContext[dataGridView1.DataSource=dmz.Tables[0]];
          foreach (DataGridViewRow dgvr in dataGridView1.Rows)
          {
  
              if (dgvr.Cells[51].Value.ToString() == "N/A") //object reference not  set to an instance of the object  exception is thrown
                  {
  
                      cm.SuspendBinding();
                      dgvr.Visible = false;
                  }
  </code></pre>
  
  <p>there is an <em>object reference not  set to an instance of the object  exception</em> thrown...
  what is triggering the error?
  Please help...</p>