title: ListView programmatically adding row after databind
body: <p>What I would like to achieve:</p>
  
  <p>I would like a user to be able in insert a row into the listview. BUT not into a database.</p>
  
  <p>What I am stuck on:</p>
  
  <p>Currently I am stuck on the OnItemCommand, i dont seem to be entering the method. Any help would be great Code below.</p>
  
  <p></p>
  
  <pre><code>&lt;LayoutTemplate&gt;
      &lt;table&gt;
          &lt;th&gt;
          &lt;/th&gt;
          &lt;th class="grayHeader"&gt;
              &lt;asp:Label ID="lblHeader" runat="server" /&gt;
          &lt;/th&gt;
          &lt;tr&gt;
              &lt;asp:PlaceHolder runat="server" ID="itemPlaceholder"&gt;&lt;/asp:PlaceHolder&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/LayoutTemplate&gt;
  &lt;ItemTemplate&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;asp:Button runat="server" ID="btnDeletePerson" Text="-"  CommandName="deletePerson"/&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;asp:Label ID="lblPerson" runat="server" Text='&lt;% #Eval("Person") %&gt;'&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/ItemTemplate&gt;
  &lt;InsertItemTemplate&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;asp:Button ID="btnAddUser" runat="server" CommandName="Insert" ext="+" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;asp:TextBox runat="server" ID="txtInsert"&gt;&lt;/asp:TextBox&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/InsertItemTemplate&gt;
  
  
  
  
  Protected Sub ListGrantee_OnItemCommand(ByVal sender As Object, ByVal e As ListViewCommandEventArgs)
      Select Case e.CommandName
          Case "Insert"
              Dim test As ListViewItem
              test = New ListViewItem("test")
              listGrantee.Items.Add(test)
          Case ""
          Case Else
      End Select
  End Sub
  </code></pre>