Vignesh Kumar

Vignesh Kumar

  • NA
  • 1k
  • 416.3k

Check if row modified in gridview c#

Apr 22 2015 3:27 AM
Hi,
I have a GridView and I'm performing a bulk update for only one column with textbox. But before update I need to check the values of that textbox for entire gridview and if the values aren't changed I need to provide an alert stating "Make change to field to update".
Can anyone suggest me some options?
protected void btnUpdate_Click(object sender, EventArgs e)
{
 try
   {
     foreach (GridViewRow row in gvDetails.Rows)
         {
           string strID = ((Label)row.FindControl("lblID")).Text;
           string strGroup = ((Label)row.FindControl("lblGrp")).Text;
           string strDept = ((TextBox)row.FindControl("txtDept")).Text;
             {
              //my update query
             }
          }
    }
catch (Exception ex)
   {
   }
}
 

Answers (2)