title: GridView - "enter" multiple rows into edit mode using checkboxes from codebehind (on button click)
body: <p>I need some help again.</p>
  
  <p>I have a <code>GridView</code> with <code>CheckBox</code>es in first column. If a user checks multiple <code>CheckBox</code>es and clicks a button I need to display selected rows in edit mode. How do I do that? Any tips? </p>
  
  <p>Some sample code, how I imagine it.</p>
  
  <p>Here is my Gridview MyGV:</p>
  
  <pre><code>&lt;asp:GridView ID="MyGV" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="ChkBox" runat="server" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField DataField="ID" HeaderText="ID" /&gt;
          &lt;asp:TemplateField HeaderText="Column1"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:TextBox ID="tbColumn1" runat="server" Text='&lt;%# Bind("column1") %&gt;'&gt;&lt;/asp:TextBox&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="labColumn1" runat="server" Text='&lt;%# Bind("column1") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Column2"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:TextBox ID="tbColumn2" runat="server" Text='&lt;%# Bind("column2") %&gt;'&gt;&lt;/asp:TextBox&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="labColumn2" runat="server" Text='&lt;%# Bind("column2") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
     &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;asp:Button ID="btnEdit" runat="server" Text="EDIT" OnClick="btnEdit_Click" /&gt;
  </code></pre>
  
  <p>In code behind I bind that <code>GridView</code> to display data from SQL table (no problem there). Now I need it to enter selected rows into edit mode (ONLY selected rows) when I click the EDIT button.</p>
  
  <pre><code>protected void btnEdit_Click(object sender, EventArgs e)
  {
      foreach (GridViewRow row in MyGV.Rows)
      {
          CheckBox checkbox = (CheckBox)row.FindControl("ChkBox");
          if (checkbox.Checked)
          {
              // ENTER EDIT MODE - Help needed here!! :)
          }
      }
      BindGridView();
  }
  </code></pre>