title: ASP.NET Hide Gridview row with Checkbox
body: <p>i am trying to create a dynamic Gridview on a ASP.NET page and i have multiple rows, and added a CheckBox Column. </p>
  
  <pre><code>&lt;body&gt;
      &lt;h1&gt;Alerts&lt;/h1&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:KiwiLogConnectionString %&gt;" SelectCommand="SELECT * FROM [Syslogd]
  GROUP BY MsgHostname, MsgDate, MsgTime, MsgPriority, MsgText"&gt;&lt;/asp:SqlDataSource&gt;
          &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" DataSourceID="SqlDataSource1" ForeColor="#333333" AllowPaging="True" PageSize="15"&gt;
              &lt;AlternatingRowStyle BackColor="White" /&gt;
              &lt;Columns&gt;
                  &lt;asp:TemplateField &gt;
                  &lt;ItemTemplate &gt;
                  &lt;asp:CheckBox ID ="Checkbox" runat="server"/&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
                  &lt;asp:BoundField DataField="MsgDate" HeaderText="Datum" SortExpression="MsgDate" ItemStyle-Wrap="false" &gt;
                      &lt;ItemStyle Wrap="False"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="MsgTime" HeaderText="Tijd" SortExpression="MsgTime" ItemStyle-Wrap="false" &gt;
                      &lt;ItemStyle Wrap="False"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="MsgPriority" HeaderText="Priority" SortExpression="MsgPriority" ItemStyle-Wrap="false" &gt;
                      &lt;ItemStyle Wrap="False"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="MsgHostname" HeaderText="Hostname" SortExpression="MsgHostname" ItemStyle-Wrap="false" &gt;
                      &lt;ItemStyle Wrap="False"&gt;&lt;/ItemStyle&gt;
                  &lt;/asp:BoundField&gt;
                  &lt;asp:BoundField DataField="MsgText" HeaderText="Message" SortExpression="MsgText" /&gt;
              &lt;/Columns&gt;
              &lt;EditRowStyle BackColor="#2461BF" /&gt;
              &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
              &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
              &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt;
              &lt;RowStyle BackColor="#EFF3FB" /&gt;
              &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt;
              &lt;SortedAscendingCellStyle BackColor="#F5F7FB" /&gt;
              &lt;SortedAscendingHeaderStyle BackColor="#6D95E1" /&gt;
              &lt;SortedDescendingCellStyle BackColor="#E9EBEF" /&gt;
              &lt;SortedDescendingHeaderStyle BackColor="#4870BE" /&gt;
          &lt;/asp:GridView&gt;
          &lt;asp:Button ID="btn_update" runat="server" OnClick="btn_update_Click" Text="Update" /&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  </code></pre>
  
  <p>If that CheckBox is checked and the "Update" Button is clicked, i want these row(s) to be hidden. How can i manage to do that?</p>
  
  <pre><code>protected void btn_update_Click(object sender, EventArgs e)
  {
  
  }
  </code></pre>
  
  <p>The gridview is build up with the SQL Database, so it has to be dynamic. In foward, many thanks!</p>