title: I can't change column values in Gridview
body: <p>I'm trying to insert an autonumber column into a datagridview control in C#.</p>
  
  <p>Everything works well, but I can't write anything to the column. It remains empty.</p>
  
  <p>How can I fix this?</p>
  
  <p>Below is my code (grv - gridview, ds-dataset):</p>
  
  <pre><code>        grv1.AutoGenerateColumns = false;
          grv1.DataSource = ds.Tables[0];        
          grv1.Columns[0].DataPropertyName = "LastName";
  
  
          DataGridViewTextBoxColumn nrCol = new DataGridViewTextBoxColumn();
          nrCol.Name = "Nr";
          nrCol.HeaderText = "Nr";
          grv.Columns.Insert(0, nrCol);
          grv.Columns[0].ReadOnly = false;
  
  
          for (int i=0;i&lt;grv.Rows.Count;i++)
          {
              grv.Rows[i].Cells[0].Value = i.ToString();       
          }
  </code></pre>