title: Stop Gridview Value to change when I click on Edit buitton
body: <p>I need help with this Gridview issue. I build a dropdown search on the Gridview base on the ID as shown by the image below</p>
  
  <p><a href="https://i.stack.imgur.com/Jc964.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jc964.jpg" alt="enter image description here"></a></p>
  
  <p>The problem I have is when I click the Edit button to update the Gridview the value of the Gridview change and go back to the first value in the table as shown by the image below</p>
  
  <p><a href="https://i.stack.imgur.com/0JLBn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0JLBn.jpg" alt="enter image description here"></a></p>
  
  <p>C# Code GridViewMYD88_RowUpdating</p>
  
  <pre><code>  protected void GridViewMYD88_RowUpdating(object sender, GridViewUpdateEventArgs e)
      {
          GridViewRow row = GridViewMYD88.Rows[e.RowIndex];
  
          Label TestID = (Label)GridViewMYD88.Rows[e.RowIndex].FindControl("lblId");
          Label SampleBranchID = (Label)GridViewMYD88.Rows[e.RowIndex].FindControl("lblSampleBranchID");
  
  
          string TechniqueforMYD88  = (row.FindControl("txtTechniqueforMYD88") as TextBox).Text;
          string MYD88ExonsAnalyzed = (row.FindControl("txtMYD88ExonsAnalyzed") as TextBox).Text;
          string SequenceofEntireMYD88 = (row.FindControl("txtSequenceofEntireMYD88") as TextBox).Text;
          string MYD88MutationStatus = (row.FindControl("txtMYD88MutationStatus") as TextBox).Text;
          string NumberofMYD88Mutations = (row.FindControl("txtNumberofMYD88Mutations") as TextBox).Text;
          string MYD88pL265PMutation = (row.FindControl("txtMYD88pL265PMutation") as TextBox).Text;
          string OtherMYD88MutationDescription = (row.FindControl("txtOtherMYD88MutationDescription") as TextBox).Text;
          string MYD88VAFPercentage = (row.FindControl("txtMYD88VAFPercentage") as TextBox).Text;
          string MYD88RefAllelesReads = (row.FindControl("txtMYD88RefAllelesReads") as TextBox).Text;
          string MYD88VariantAllelesReads = (row.FindControl("txtMYD88VariantAllelesReads") as TextBox).Text;
          string MYD88OverallReadDepth = (row.FindControl("txtMYD88OverallReadDepth") as TextBox).Text;
  
          using (SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["Molecular"].ConnectionString))
          {
              con.Open();
  
              using (SqlCommand sc = new SqlCommand(@"UPDATE MutationResults
  
                              SET TechniqueforMYD88=@TechniqueforMYD88, MYD88ExonsAnalyzed=@MYD88ExonsAnalyzed, SequenceofEntireMYD88=@SequenceofEntireMYD88,
  
                              MYD88MutationStatus=@MYD88MutationStatus, NumberofMYD88Mutations=@NumberofMYD88Mutations, MYD88pL265PMutation=@MYD88pL265PMutation,
  
                              OtherMYD88MutationDescription=@OtherMYD88MutationDescription, MYD88VAFPercentage=@MYD88VAFPercentage, MYD88RefAllelesReads=@MYD88RefAllelesReads,
  
                              MYD88VariantAllelesReads=@MYD88VariantAllelesReads, MYD88OverallReadDepth=@MYD88OverallReadDepth
  
                               WHERE 
  
                              ID=@TestID and SampleBranchID=@SampleBranchID", con))
              {
                  sc.Parameters.AddWithValue("@TestID", TestID.Text);
                  sc.Parameters.AddWithValue("@SampleBranchID", SampleBranchID.Text);
                  sc.Parameters.AddWithValue("@TechniqueforMYD88", TechniqueforMYD88);
                  sc.Parameters.AddWithValue("@MYD88ExonsAnalyzed", MYD88ExonsAnalyzed);
                  sc.Parameters.AddWithValue("@SequenceofEntireMYD88", SequenceofEntireMYD88);
                  sc.Parameters.AddWithValue("@MYD88MutationStatus", MYD88MutationStatus);
                  sc.Parameters.AddWithValue("@NumberofMYD88Mutations", NumberofMYD88Mutations);
                  sc.Parameters.AddWithValue("@MYD88pL265PMutation", MYD88pL265PMutation);
                  sc.Parameters.AddWithValue("@OtherMYD88MutationDescription", OtherMYD88MutationDescription);
                  sc.Parameters.AddWithValue("@MYD88VAFPercentage", MYD88VAFPercentage);
                  sc.Parameters.AddWithValue("@MYD88RefAllelesReads", MYD88RefAllelesReads);
                  sc.Parameters.AddWithValue("@MYD88VariantAllelesReads", MYD88VariantAllelesReads);
                  sc.Parameters.AddWithValue("@MYD88OverallReadDepth", MYD88OverallReadDepth);
  
                  sc.ExecuteScalar();
  
              }
              con.Close();
          }
  
  
          GridViewMYD88.EditIndex = -1;
          this.BindGridMutationResults();
      }
  </code></pre>
  
  <p>Any help how to solve this issue. Thanks</p>