One Button to update GridView <p>I want to update all rows of a GridView one time by clicking one button: aspx:</p> <pre><code>&lt;/asp:ObjectDataSource&gt; &lt;asp:ListBox ID="ListBoxRoles" runat="server" DataSourceID="ObjectDataSourceAllRoles" AutoPostBack="true" DataTextField="RoleName" DataValueField="RoleID" OnSelectedIndexChanged="ListBoxRoles_SelectedIndexChanged"&gt; &lt;/asp:ListBox&gt; &lt;asp:ObjectDataSource ID="ObjectDataSourceRolePermissions" runat="server" TypeName="RolePermission" SelectMethod="GetRolePermissionByRoleID" UpdateMethod="UpdateRolePermission"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter ControlID="ListBoxRoles" Name="RoleID" PropertyName="SelectedValue" Type="String" /&gt; &lt;/SelectParameters&gt; &lt;UpdateParameters&gt; &lt;asp:ControlParameter ControlID="ListBoxRoles" Name="RoleID" PropertyName="SelectedValue" Type="String" /&gt; &lt;/UpdateParameters&gt; &lt;/asp:ObjectDataSource&gt; &lt;asp:GridView ID="GridViewRolePermission" SkinID="GridViewSecurity" runat="server" style="width: 100%;" HeaderStyle-Height="50" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="ObjectDataSourceRolePermissions"&gt; &lt;Columns&gt; &lt;asp:BoundField ItemStyle-HorizontalAlign="Center" DataField="PermissionName" SortExpression="PermissionName" /&gt; &lt;asp:TemplateField ItemStyle-HorizontalAlign="Center"&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox ID="CheckBoxRead" runat="server" Checked='&lt;%#Bind("Read") %&gt;' /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-HorizontalAlign="Center"&gt; &lt;ItemTemplate&gt; &lt;asp:CheckBox ID="CheckBoxUpdate" runat="server" Checked='&lt;%#Bind("Update") %&gt;' /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/asp:GridView&gt; &lt;asp:Button runat="server" ID="ButtonUpdateRolePermissions" Text="Save" OnClick="ButtonUpdateRolePermissions_Click" /&gt; </code></pre> <p>I want to update all rows of the gridview once the ButtonUpdateRolePermissions clicked. I tried:</p> <pre><code> protected void ButtonupdateRolePermissions_Click(object sender, EventArgs e) { foreach(GridViewRow RolePermission in this.GridViewRolePermission.Rows) { this.ObjectDataSourceRolePermissions.Update(); } } </code></pre> <p>but the update method not take Update and Read fields into consideration.</p>