title: Refresh GridView after update
body: <p>Basically, the GridView is not showing the updated values after the update event occurs.  I have searched the forum and seen many solutions but nothing has worked when I tried them out.</p>
  
  <p>The database is definitely updated but the updates are only visible once I restart the project.</p>
  
  <p>What I have done:</p>
  
  <ul>
  <li>Very liberal use of GridView1.Databind();</li>
  <li>Conservative use of GridView1.Databind();</li>
  <li>Page_Load contains (!IsPostBack) wrapper with GridView1.Databind();</li>
  <li>Placed  GridView1.Databind(); in the GridView1_RowUpdating event.</li>
  <li>...and a number of other things that I tried after searching the forum.</li>
  </ul>
  
  <p>C#:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Security;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.UI.HtmlControls;
  using System.Text;
  using System.Data;
  using System.Configuration;
  using System.Data.SqlClient;
  using System.IO;
  
  public partial class Styles_ConsolidatedProducers : System.Web.UI.Page
  {
  
  protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
      GridView1.DataBind();
  }
  
  protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          GridView1.DataBind();
      }
      else
      {
          //GridView1.DataBind();
      }
  }
  
  public override void VerifyRenderingInServerForm(Control control)
  {
      /* Verifies that the control is rendered */
  }
  
  protected void Gridview1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  {
      GridView1.PageIndex = e.NewPageIndex;
      GridView1.DataBind();
  }
  protected void cmdReset_Click(object sender, EventArgs e)
  {
  
      ToggleCheckState(false);
      cboBusinessSource.ClearSelection();
      cboConsolidatedProducer.ClearSelection();
      cboRelinkToConsolidatedProducer.ClearSelection();
      txtSearch.Text = "";
      lblRelinkToConsolidatedProducer.Visible = false;
      cboRelinkToConsolidatedProducer.Visible = false;
      cmdRelink.Visible = false;
      GridView1.DataBind();
  
  }
  protected void cboConsolidatedProducer_SelectedIndexChanged(object sender, EventArgs e)
  {
      //GridView1.DataBind();
  }
  protected void cboBusinessSource_SelectedIndexChanged(object sender, EventArgs e)
  {
      //GridView1.DataBind();
  }
  
  protected void cmdUnlink_Click(object sender, EventArgs e)
  
  {
      {
          bool atLeastOneRowUpdated = false;
          // Iterate through the Products.Rows property
          foreach (GridViewRow row in GridView1.Rows)
          {
              // Access the CheckBox
              CheckBox cb = (CheckBox)row.FindControl("chkUpdate");
              if (cb != null &amp;&amp; cb.Checked)
              {
                  // Edit row is true.
                  atLeastOneRowUpdated = true;
                  // Get the MasterID for the selected row.
                  int MasterID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
  
                  SqlConnection con = new SqlConnection("FOO");
                  con.Open();
  
                  string updateSQL = "UPDATE tblMasterDetail " + "SET     ProducerConsolidatedID = @ProducerConsolidatedID, ProducerConsolidatedName = @ProducerConsolidatedName WHERE MasterID = @MasterID";
                  Console.WriteLine(updateSQL);
                  SqlCommand cmd = new SqlCommand(updateSQL, con);
                  cmd.Parameters.Add("@MasterID", SqlDbType.Int, 10, "MasterID");
                  cmd.Parameters.Add("@ProducerConsolidatedID", SqlDbType.NVarChar, 20, "ProducerConsolidatedID");
                  cmd.Parameters.Add("@ProducerConsolidatedName", SqlDbType.NVarChar, 20, "ProducerConsolidatedName");
                  //cmd.Parameters["@ProducerConsolidatedID"].Value = MasterID;
                  cmd.Parameters["@MasterID"].Value = MasterID;
                  cmd.Parameters["@ProducerConsolidatedID"].Value = "XX";
                  cmd.Parameters["@ProducerConsolidatedName"].Value = "XX";
                  //Update the row.
                  cmd.ExecuteNonQuery();
                  GridView1.DataBind();
                  con.Close();
                  ToggleCheckState(false);
                  lblUpdatedRecords.Text += string.Format(
                      "Record unlinked: {0}&lt;br /&gt;", MasterID);
                  //"This would have updated ProductID {0}&lt;br /&gt;", MasterID);
              }
          }
          // Show the Label if at least one row was deleted...
          lblUpdatedRecords.Visible = atLeastOneRowUpdated;
      }
  }
  
  private void ToggleCheckState(bool checkState)
  {
      // Iterate through the Products.Rows property
      foreach (GridViewRow row in GridView1.Rows)
      {
          // Access the CheckBox
          CheckBox cb = (CheckBox)row.FindControl("chkUpdate");
          if (cb != null)
              cb.Checked = checkState;
      }
  }
  
  protected void cmdUncheckAll_Click(object sender, EventArgs e)
  {
      ToggleCheckState(false);
      cboRelinkToConsolidatedProducer.Visible = false;
      lblRelinkToConsolidatedProducer.Visible = false;
      cmdRelink.Visible = false;
  }
  protected void txtSearch_TextChanged(object sender, EventArgs e)
  {
      //GridView1.DataBind();
  }
  
  protected void cboRelinkToConsolidatedProducer_SelectedIndexChanged(object sender, EventArgs e)
  {
      // Get value form dropdown.
      txtRelinkToConsolidatedProducerID.Text = cboRelinkToConsolidatedProducer.SelectedItem.Value;
      // Get value form dropdown.
      txtRelinkToConsolidatedProducerName.Text = cboRelinkToConsolidatedProducer.SelectedItem.Text;
      cmdRelink.Visible = true;
      //GridView1.DataBind();
  }
  protected void cmdRelinkTo_Click(object sender, EventArgs e)
  {
      lblRelinkToConsolidatedProducer.Visible = true;
      cboRelinkToConsolidatedProducer.Visible = true;
  }
  protected void cmdRelink_Click(object sender, EventArgs e)
  {
      bool atLeastOneRowUpdated = false;
      // Iterate through the Products.Rows property
      foreach (GridViewRow row in GridView1.Rows)
      {
          // Access the CheckBox
          CheckBox cb = (CheckBox)row.FindControl("chkUpdate");
          if (cb != null &amp;&amp; cb.Checked)
          {
              // Edit row is true.
              atLeastOneRowUpdated = true;
              // Get the MasterID for the selected row.
              int MasterID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
  
              SqlConnection con = new SqlConnection("FOO");
              //con.Open();
  
              string updateSQL = "UPDATE tblMasterDetail " + "SET ProducerConsolidatedID = @ProducerConsolidatedID, ProducerConsolidatedName = @ProducerConsolidatedName WHERE MasterID = @MasterID";
              Console.WriteLine(updateSQL);
              SqlCommand cmd = new SqlCommand(updateSQL, con);
              cmd.Parameters.Add("@MasterID", SqlDbType.Int, 10, "MasterID");
              cmd.Parameters.Add("@ProducerConsolidatedID", SqlDbType.NVarChar, 20, "ProducerConsolidatedID");
              cmd.Parameters.Add("@ProducerConsolidatedName", SqlDbType.NVarChar, 20, "ProducerConsolidatedName");
              cmd.Parameters["@MasterID"].Value = MasterID;
              cmd.Parameters["@ProducerConsolidatedID"].Value = txtRelinkToConsolidatedProducerID.Text; 
              cmd.Parameters["@ProducerConsolidatedName"].Value = txtRelinkToConsolidatedProducerName.Text;
              con.Open();
              //Update the row.
              cmd.ExecuteNonQuery();
              GridView1.DataBind();
              con.Close();
              ToggleCheckState(false);
              lblUpdatedRecords.Text += string.Format(
                  "Records relinked: {0}&lt;br /&gt;", MasterID);
              //"This would have updated ProductID {0}&lt;br /&gt;", MasterID);
              cboRelinkToConsolidatedProducer.Visible = false;
              lblRelinkToConsolidatedProducer.Visible = false;
              cmdRelink.Visible = false;
          }
      }
      // Show the Label if at least one row was deleted...
      lblUpdatedRecords.Visible = atLeastOneRowUpdated;
  }
  
  protected void cmdRefresh_Click(object sender, EventArgs e)
  {
      GridView1.DataBind();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Markup:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" Debug="true"     EnableEventValidation="true" CodeFile="Search.aspx.cs" Inherits="Styles_ConsolidatedProducers"
  EnableViewStateMac ="false" EnableSessionState="True" ValidateRequest ="false" ViewStateEncryptionMode ="Never" %&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;Producer Search&lt;/title&gt;
  &lt;style type="text/css"&gt;
      .style1
      {
          font-family: Calibri;
      }
      .style2
      {
          color: #FFFFFF;
      }
      .style3
      {
          font-size: xx-large;
      }
      #form1
      {
          font-family: Calibri;
      }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;div style="background-color: #000000; width: 1251px;"&gt;
  
      &lt;asp:Image ID="Image1" runat="server" Height="63px" ImageAlign="Left" 
          ImageUrl="~/BM.jpg" Width="93px" /&gt;
      &lt;br /&gt;
      &lt;span class="style1"&gt;
      &lt;span class="style2"&gt;&lt;span class="style3"&gt;search&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br 
          class="style3" /&gt;
      &lt;span class="style1"&gt;&lt;span class="style2"&gt;
      &lt;br /&gt;
      &lt;/span&gt;&lt;/span&gt;&amp;nbsp;
      &lt;asp:Label ID="lblConsolidatedProducer" runat="server" style="color: #FFFFFF" 
          Text="Consol. Producer:"&gt;&lt;/asp:Label&gt;
      &lt;asp:DropDownList ID="cboConsolidatedProducer" AppendDataBoundItems="true" runat="server" 
          AutoPostBack="True" DataSourceID="ConsolidatedProducer" 
          DataTextField="ProducerConsolidatedName" 
          DataValueField="ProducerConsolidatedID" Height="22px" Width="259px" 
          onselectedindexchanged="cboConsolidatedProducer_SelectedIndexChanged"&gt;
          &lt;asp:ListItem Value="%" Selected="True"&gt;None&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="XX"&gt;Unlinked&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
      &lt;span class="style1"&gt;
      &lt;asp:Label ID="lblBusinessSource" runat="server" style="color: #FFFFFF" 
          Text="Source:"&gt;&lt;/asp:Label&gt;
      &lt;/span&gt;
      &lt;asp:DropDownList ID="cboBusinessSource" AppendDataBoundItems="true" 
          runat="server" AutoPostBack="True" 
          DataSourceID="BusinessSource" DataTextField="BusinessSourceCode" 
          DataValueField="BusinessSourceCode" Height="22px" Width="65px" 
          onselectedindexchanged="cboBusinessSource_SelectedIndexChanged"&gt;
          &lt;asp:ListItem Value="%" Selected="True"&gt;All&lt;/asp:ListItem&gt;
          &lt;/asp:DropDownList&gt;
      &lt;asp:Label ID="lblSearch" runat="server" style="color: #FFFFFF" 
      Text="Producer Name:"&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="txtSearch" runat="server" 
          ontextchanged="txtSearch_TextChanged" AutoCompleteType="Disabled" 
          AutoPostBack="True" MaxLength="50"&gt;&lt;/asp:TextBox&gt;
      &lt;asp:SqlDataSource ID="BusinessSource" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:BMBESQLConnectionString %&gt;" 
          SelectCommand="SELECT DISTINCT [BusinessSourceCode] FROM [tblMasterDetail] WHERE ([BusinessSourceCode] IS NOT NULL)" 
          CancelSelectOnNullParameter="False"&gt;
      &lt;/asp:SqlDataSource&gt;
  &lt;asp:SqlDataSource ID="MasterDetail" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:BMBESQLConnectionString %&gt;" 
      SelectCommand="SELECT MasterID, SystemSourceCode, BusinessSourceCode, PRODUCERMASTERID, PRODUCERCONSOLIDATEDID, ProducerConsolidatedName, GWP, FINMISNATIONALCODE, PRODUCERNATIONALCODE, PRODUCERNAME, [Update] FROM tblMasterDetail" EnableCaching="True"
      FilterExpression="[ProducerConsolidatedID] LIKE '{0}%' and [BusinessSourceCode] LIKE '{1}%' and [ProducerName] Like '%{2}%'" 
      CancelSelectOnNullParameter="False" 
      OldValuesParameterFormatString="original_{0}" 
      InsertCommand="INSERT INTO [tblMasterDetail] ([SystemSourceCode], [BusinessSourceCode], [PRODUCERMASTERID], [PRODUCERCONSOLIDATEDID], [ProducerConsolidatedName], [GWP], [PRODUCERNATIONALCODE], [FINMISNATIONALCODE], [PRODUCERNAME], [Update]) VALUES (@SystemSourceCode, @BusinessSourceCode, @PRODUCERMASTERID, @PRODUCERCONSOLIDATEDID, @ProducerConsolidatedName, @GWP, @PRODUCERNATIONALCODE, @FINMISNATIONALCODE, @PRODUCERNAME, @Update);" 
      DeleteCommand="DELETE FROM [tblMasterDetail] WHERE [MasterID] = @original_MasterID AND (([SystemSourceCode] = @original_SystemSourceCode) OR ([SystemSourceCode] IS NULL AND @original_SystemSourceCode IS NULL)) AND (([BusinessSourceCode] = @original_BusinessSourceCode) OR ([BusinessSourceCode] IS NULL AND @original_BusinessSourceCode IS NULL)) AND (([PRODUCERMASTERID] = @original_PRODUCERMASTERID) OR ([PRODUCERMASTERID] IS NULL AND @original_PRODUCERMASTERID IS NULL)) AND (([PRODUCERCONSOLIDATEDID] = @original_PRODUCERCONSOLIDATEDID) OR ([PRODUCERCONSOLIDATEDID] IS NULL AND @original_PRODUCERCONSOLIDATEDID IS NULL)) AND (([ProducerConsolidatedName] = @original_ProducerConsolidatedName) OR ([ProducerConsolidatedName] IS NULL AND @original_ProducerConsolidatedName IS NULL)) AND (([GWP] = @original_GWP) OR ([GWP] IS NULL AND @original_GWP IS NULL)) AND (([PRODUCERNATIONALCODE] = @original_PRODUCERNATIONALCODE) OR ([PRODUCERNATIONALCODE] IS NULL AND @original_PRODUCERNATIONALCODE IS NULL)) AND (([FINMISNATIONALCODE] = @original_FINMISNATIONALCODE) OR ([FINMISNATIONALCODE] IS NULL AND @original_FINMISNATIONALCODE IS NULL)) AND (([PRODUCERNAME] = @original_PRODUCERNAME) OR ([PRODUCERNAME] IS NULL AND @original_PRODUCERNAME IS NULL)) AND (([Update] = @original_Update) OR ([Update] IS NULL AND @original_Update IS NULL))" 
      ConflictDetection="CompareAllValues"&gt;
      &lt;DeleteParameters&gt;
          &lt;asp:Parameter Name="original_MasterID" /&gt;
          &lt;asp:Parameter Name="original_SystemSourceCode" /&gt;
          &lt;asp:Parameter Name="original_BusinessSourceCode" /&gt;
          &lt;asp:Parameter Name="original_PRODUCERMASTERID" /&gt;
          &lt;asp:Parameter Name="original_PRODUCERCONSOLIDATEDID" /&gt;
          &lt;asp:Parameter Name="original_ProducerConsolidatedName" /&gt;
          &lt;asp:Parameter Name="original_GWP" /&gt;
          &lt;asp:Parameter Name="original_PRODUCERNATIONALCODE" /&gt;
          &lt;asp:Parameter Name="original_FINMISNATIONALCODE" /&gt;
          &lt;asp:Parameter Name="original_PRODUCERNAME" /&gt;
          &lt;asp:Parameter Name="original_Update" /&gt;
      &lt;/DeleteParameters&gt;
      &lt;FilterParameters&gt;
          &lt;asp:ControlParameter ControlID="cboConsolidatedProducer" 
              Name="ProducerConsolidatedID" PropertyName="SelectedValue" 
              DefaultValue="" ConvertEmptyStringToNull="true" /&gt;
          &lt;asp:ControlParameter ControlID="cboBusinessSource" Name="BusinessSourceCode" 
              PropertyName="SelectedValue" ConvertEmptyStringToNull="true" 
              DefaultValue=" " /&gt;
          &lt;asp:ControlParameter ControlID="txtSearch" DefaultValue=" " Name="ProducerName" 
              PropertyName="Text" Type="String" /&gt;
      &lt;/FilterParameters&gt;
  
      &lt;InsertParameters&gt;
          &lt;asp:Parameter Name="SystemSourceCode" /&gt;
          &lt;asp:Parameter Name="BusinessSourceCode" /&gt;
          &lt;asp:Parameter Name="PRODUCERMASTERID" /&gt;
          &lt;asp:Parameter Name="PRODUCERCONSOLIDATEDID" /&gt;
          &lt;asp:Parameter Name="ProducerConsolidatedName" /&gt;
          &lt;asp:Parameter Name="GWP" /&gt;
          &lt;asp:Parameter Name="PRODUCERNATIONALCODE" /&gt;
          &lt;asp:Parameter Name="FINMISNATIONALCODE" /&gt;
          &lt;asp:Parameter Name="PRODUCERNAME" /&gt;
          &lt;asp:Parameter Name="Update" /&gt;
      &lt;/InsertParameters&gt;
  
  &lt;/asp:SqlDataSource&gt;
      &lt;asp:SqlDataSource ID="ConsolidatedProducer" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:BMBESQLConnectionString %&gt;" 
  
          SelectCommand="SELECT DISTINCT ProducerConsolidatedName, ProducerConsolidatedID FROM tblProducerConsolidated WHERE (MakeConsolidated = 1) ORDER BY ProducerConsolidatedName" 
          CancelSelectOnNullParameter="False"&gt;
      &lt;/asp:SqlDataSource&gt;
  
  &lt;asp:Button ID="cmdReset" runat="server" onclick="cmdReset_Click" 
      Text="Reset" /&gt;
  
      &lt;br /&gt;
      &lt;br /&gt;
  
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;asp:Button ID="cmdRelinkTo" runat="server" Text="Relink" 
      onclick="cmdRelinkTo_Click" /&gt;
  &lt;asp:Button ID="cmdUnlink" runat="server" Text="Unlink" 
      onclick="cmdUnlink_Click" /&gt;
  &lt;asp:Label ID="lblRelinkToConsolidatedProducer" runat="server" 
      Text="Relink To:" Visible="False"&gt;&lt;/asp:Label&gt;
  &lt;asp:DropDownList ID="cboRelinkToConsolidatedProducer" runat="server" 
      AutoPostBack="True" DataSourceID="ConsolidatedProducer" 
      DataTextField="ProducerConsolidatedName" 
      DataValueField="ProducerConsolidatedID" Height="22px" 
      onselectedindexchanged="cboRelinkToConsolidatedProducer_SelectedIndexChanged" 
      Visible="False" Width="259px"&gt;
  &lt;/asp:DropDownList&gt;
  &lt;br /&gt;
  &lt;asp:Button ID="cmdRelink" runat="server" onclick="cmdRelink_Click" 
      Text="Relink" Visible="False" /&gt;
  &lt;asp:TextBox ID="txtRelinkToConsolidatedProducerID" runat="server" 
      Visible="False"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:TextBox ID="txtRelinkToConsolidatedProducerName" runat="server" 
      Visible="False"&gt;&lt;/asp:TextBox&gt;
  &lt;br /&gt;
  &lt;asp:Button ID="cmdUncheckAll" runat="server" onclick="cmdUncheckAll_Click" 
      Text="Clear" Height="26px" Width="54px" /&gt;
  &lt;asp:Button ID="cmdRefresh" runat="server" onclick="cmdRefresh_Click" 
      Text="Refresh" /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;asp:Label ID="lblRecordsFound" runat="server" style="color: #000000" Text="-"&gt;&lt;/asp:Label&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
      AllowSorting="True" AutoGenerateColumns="False" 
      DataSourceID="MasterDetail"
      onrowupdating="GridView1_RowUpdating"
      Width="1243px" EmptyDataText="-"
      DataKeyNames="MasterID"&gt;
      &lt;Columns&gt;
          &lt;asp:HyperLinkField DataNavigateUrlFields="MasterID" 
              DataNavigateUrlFormatString="ProducerDetail.aspx?masterid={0}" Text="View" /&gt;
          &lt;asp:TemplateField HeaderText="Update" SortExpression="Update"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:CheckBox ID="Update" runat="server" Checked='&lt;%# Bind("Update") %&gt;' 
                      AutoPostBack='&lt;%# Bind("Update") %&gt;' /&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="chkUpdate" runat="server" Checked='&lt;%# Bind("Update") %&gt;' 
                      AutoPostBack='&lt;%# Bind("Update") %&gt;' /&gt;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField DataField="MasterID" HeaderText="ID" 
              InsertVisible="False" ReadOnly="True" SortExpression="MasterID" /&gt;
          &lt;asp:BoundField DataField="SystemSourceCode" HeaderText="System" 
              ReadOnly="True" SortExpression="SystemSourceCode" /&gt;
          &lt;asp:BoundField DataField="BusinessSourceCode" HeaderText="Source" 
              ReadOnly="True" SortExpression="BusinessSourceCode" /&gt;
          &lt;asp:BoundField DataField="PRODUCERNAME" HeaderText="Producer Name" 
              ReadOnly="True" SortExpression="PRODUCERNAME" &gt;
          &lt;ControlStyle Width="100px" /&gt;
          &lt;/asp:BoundField&gt;
          &lt;asp:BoundField DataField="GWP" 
              HeaderText="GWP" SortExpression="GWP" DataFormatString="{0:c}" 
              ReadOnly="True" ApplyFormatInEditMode="True" /&gt;
          &lt;asp:BoundField DataField="PRODUCERMASTERID" HeaderText="Producer Master ID" 
              ReadOnly="True" SortExpression="PRODUCERMASTERID" &gt;
          &lt;ControlStyle Width="100px" /&gt;
          &lt;/asp:BoundField&gt;
          &lt;asp:TemplateField HeaderText="Consol. ID" 
              SortExpression="PRODUCERCONSOLIDATEDID"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:TextBox ID="txtConsolidatedProducerID" runat="server" 
                      Text='&lt;%# Bind("PRODUCERCONSOLIDATEDID") %&gt;' AutoPostBack="True" CausesValidation="True"&gt;&lt;/asp:TextBox&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:TextBox ID="ConsolidatedProducerID" runat="server" 
                      Text='&lt;%# Bind("PRODUCERCONSOLIDATEDID") %&gt;' AutoPostBack="True" CausesValidation="True"&gt;&lt;/asp:TextBox&gt;
              &lt;/ItemTemplate&gt;
              &lt;ControlStyle Width="100px" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Consol. Name" 
              SortExpression="PRODUCERCONSOLIDATEDID"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:TextBox ID="txtConsolidatedProducerName" runat="server" 
                      Text='&lt;%# Bind("ProducerConsolidatedName") %&gt;' AutoPostBack="True" CausesValidation="True"&gt;&lt;/asp:TextBox&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:TextBox ID="ConsolidatedProducerName" runat="server" 
                      Text='&lt;%# Bind("ProducerConsolidatedName") %&gt;' AutoPostBack="True" CausesValidation="True"&gt;&lt;/asp:TextBox&gt;
              &lt;/ItemTemplate&gt;
              &lt;ControlStyle Width="100px" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField DataField="PRODUCERNATIONALCODE" 
              HeaderText="Source Code" 
              SortExpression="PRODUCERNATIONALCODE" ReadOnly="True" /&gt;
          &lt;asp:BoundField DataField="FINMISNATIONALCODE" HeaderText="FINMIS Code" 
              ReadOnly="True" SortExpression="FINMISNATIONALCODE" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;asp:Label ID="lblUpdatedRecords" runat="server" EnableViewState="False"&gt;&lt;/asp:Label&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>All other functions work - this is the only outstanding issue.  Any guidance is appreciated.</p>