GridView does not update values on postback?
<p>I have a gridview with some custom templates:</p>

<pre><code> &lt;asp:GridView ID="gvGroups" runat="server" AutoGenerateColumns="False"
     CssClass="table table-hover table-striped" GridLines="None" &gt;
        &lt;Columns&gt;
            &lt;asp:BoundField DataField="GroupDescription" HeaderText="Name" ReadOnly="True" 
                SortExpression="GroupDescription" /&gt;
            &lt;asp:TemplateField HeaderText="Administrator"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:CheckBox ID="cbAdmin" runat="server" 
                    Checked='&lt;%# Boolean.Parse((Boolean)Eval("IsReadOnly") ? "True" : "False") ? false : true %&gt;'/&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="Remove"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:CheckBox ID="cbRemove" runat="server" /&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="ID" SortExpression="GroupID" Visible="False"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:Label ID="lblID" runat="server" Text='&lt;%# Bind("GroupID") %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;
    &lt;/asp:GridView&gt;
</code></pre>

<p>I then have a button that I click and that is supposed to change group administration and remove groups that are checked.</p>

<p>Here is the button code:</p>

<pre><code>  protected void btnSave_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gvr in gvGroups.Rows)
            {
                CheckBox cbAdmin = (CheckBox)gvr.FindControl("cbAdmin");
                CheckBox cbRemove = (CheckBox)gvr.FindControl("cbRemove");
                Label lblID = (Label)gvr.FindControl("lblID");
                int id;
                bool idValid = int.TryParse(lblID.Text,out id);
                bool isReadOnly = !cbAdmin.Checked;


                if (idValid)
                {
                    Group g = SecurityManager.GetGroup(id);

                    if (g.IsReadOnly != isReadOnly)
                    {
                        bool updateSuccess = SecurityManager.ChangeGroupPermissions(id, isReadOnly);
                    }

                    if (cbRemove.Checked)
                    {
                        bool removeEmpSuccess = SecurityManager.RemoveEmployeesFromGroup(id);
                        bool removeSuccess = SecurityManager.RemoveGroup(id);
                    }
                }
            }
        }
</code></pre>

<p>I used the debugger and even when I uncheck admin on all groups, when I look at cbAdmin.Checked, it is still true, which is the same value it started with, thus nothing ever happens.</p>

<p>What could be the problem? Why am I not seeing the updated values on the button postback?</p>

<p>Thanks</p>
