Custom asp grid view , Using checkbox i want to group selected rows. (Grouping a normal grid rows and bind it back in edit mode)
<p>i have asp:grid view which is doing DML operations. I have created it. using follwoing code. Grid contains Textboxs,dropdown, link buttons.this image is the edit mode.</p>

<p>Now i what i want is i select 2 check boxs and click Group button one Pop screen will appear which will form Something like this </p>

<ol>
<li>Security Type or Security Model   (Radio buttons )
2.Security Type and Security Model </li>
</ol>

<p>Click Done so the selected Item will come back to Grid and Form a Gruop of Selected Rows and Outer check box will be created. </p>

<pre><code>  &lt;asp:GridView ID="gvExpression" AutoGenerateColumns="False" BorderColor="White" BorderStyle="Ridge"
        CellSpacing="1" CellPadding="3" GridLines="Both" BackColor="White" BorderWidth="2px"
        EmptyDataText="No data available." runat="server" OnRowEditing="gvExpression_RowEditing"
        OnRowCancelingEdit="gvExpression_RowCancelingEdit" OnRowUpdating="gvExpression_RowUpdating"
        OnRowDataBound="gvExpression_RowDataBound" DataKeyNames="ID"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:CheckBox ID="chkGroup" runat="server" /&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="true" Visible="false"&gt;&lt;/asp:BoundField&gt;
            &lt;asp:TemplateField HeaderText="Filed Name"&gt;
                &lt;HeaderStyle HorizontalAlign="Left" Width="200px" /&gt;
                &lt;ItemStyle HorizontalAlign="Left" Width="200px" /&gt;
                &lt;ItemTemplate&gt;
                    &lt;%#Eval("FiledName")%&gt;
                    &lt;asp:LinkButton ID="btnApplyFunction" runat="server" CommandName="ApplyFunction" Text="ApplyFunction" /&gt;
                &lt;/ItemTemplate&gt;
                &lt;EditItemTemplate&gt;
                    &lt;asp:TextBox ID="txtFieldName" Text='&lt;%#Eval("FiledName")%&gt;' runat="server" /&gt;
                &lt;/EditItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="Operators"&gt;
                &lt;HeaderStyle HorizontalAlign="Left" Width="30px" /&gt;
                &lt;ItemStyle HorizontalAlign="Left" /&gt;
                &lt;ItemTemplate&gt;
                    &lt;%#Eval("Operators")%&gt;&lt;/ItemTemplate&gt;
                &lt;EditItemTemplate&gt;
                    &lt;asp:DropDownList ID="ddlOperator" runat="server"&gt;
                    &lt;/asp:DropDownList&gt;
                &lt;/EditItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="Value"&gt;
                &lt;HeaderStyle HorizontalAlign="Left" Width="100px" /&gt;
                &lt;ItemStyle HorizontalAlign="Left" Width="100px" /&gt;
                &lt;ItemTemplate&gt;
                    &lt;%#Eval("Value")%&gt;
                &lt;/ItemTemplate&gt;
                &lt;EditItemTemplate&gt;
                    &lt;asp:TextBox ID="txtValue" Text='&lt;%#Eval("Value")%&gt;' runat="server" /&gt;
                &lt;/EditItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:LinkButton ID="btnedit" runat="server" CommandName="Edit" Text="Edit" /&gt;
                &lt;/ItemTemplate&gt;
                &lt;EditItemTemplate&gt;
                    &lt;asp:LinkButton ID="btnupdate" runat="server" CommandName="Update" Text="Save" /&gt;
                    &lt;asp:LinkButton ID="btncancel" runat="server" CommandName="Cancel" Text="Cancel" /&gt;
                &lt;/EditItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;  
    &lt;/asp:GridView&gt;
    &lt;%#Eval("FiledName")%&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;tr align="center"&gt;
        &lt;td align="center"&gt;
            &lt;asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" /&gt;
        &lt;/td&gt;
        &lt;td align="center"&gt;
            &lt;asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="Delete" /&gt;
        &lt;/td&gt;
        &lt;td align="center"&gt;
            &lt;asp:Button ID="btnGroup" runat="server" OnClick="btnGroup_Click" Text="Group" /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
</code></pre>
