how to update only the updated rows in gridview?
<p>what is the handiest way to update only the updated rows (only the checkbox column) in this gridview? what is a handy way to check wether the row was updated?</p>

<p>c#</p>

<pre><code>public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List&lt;customer&gt; listCustomer = new List&lt;customer&gt;();
            customer cust1 = new customer(){name="fred",email="fred@mail.com",jobless="true"};
            customer cust2 = new customer(){name="mark",email="mark@mail.com",jobless="false"};
            listCustomer.Add(cust1);
            listCustomer.Add(cust2);
            GridView1.DataSource=listCustomer;
            GridView1.DataBind();
        }


    }
</code></pre>

<p>protected void btnUpdate_Click1(object sender, EventArgs e)
        {
            foreach (GridViewRow rw in GridView1.Rows)
            {
                CheckBox thiscontrol = (CheckBox)rw.Cells[0].FindControl("cb");
                var ch = thiscontrol.Checked;
                //only update the updated rows?
            }
        }</p>

<pre><code>    public class customer
    {
        public string name { get; set; }
        public string email { get; set; }
        public string jobless { get; set; }

    }
</code></pre>

<p>html</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="gridviewUpdate._Default" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server"&gt;
            &lt;Columns&gt;
                &lt;asp:TemplateField&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:CheckBox ID="jobless" runat="server" Checked='&lt;%# Eval("jobless").ToString().Equals("true") %&gt;' /&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;asp:BoundField DataField="email" /&gt;
                &lt;asp:BoundField DataField="name" /&gt;

            &lt;/Columns&gt;
        &lt;/asp:GridView&gt;
    &lt;/div&gt;
</code></pre>

<p>
        
    
    </p>
