title: How to add a new record to datagridview control in Visual Basic?
body: <p>I want to add to my site a simple table/excel-like feauture that will display some values. So, I added a gridview. I don't use Datasets or database biding at all. All I have is a small form with two entries. When the user clicks a button, I want to add some values to the datagridview control as a new row. How do I add a new record to datagridview control in VB.NET?</p>
  
  <p>I have tried this code:</p>
  
  <pre><code>GridView1.Rows.Add(New String() {Value1, Value2})
  </code></pre>
  
  <p>but I get an error that:</p>
  
  <blockquote>
    <p>'Add' is not a member of 'System.Web.UI.WebControls.GridViewRowCollection'</p>
  </blockquote>
  
  <p>My ASPX:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" Width="731px"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField HeaderText="Name" /&gt;
          &lt;asp:BoundField HeaderText="Grade" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>