when i am editing row in gridview ,then it take me another line for editing
For example If I am editing IDOD 36387 line, then i click on edit, it take me on IDOD 36389.
protected void gv1_RowEditing(object sender, GridViewEditEventArgs e)
{
gv1.EditIndex = e.NewEditIndex;
BindGrid(searchono.Text.Trim());
}
public void BindGrid(string Order_Ref_No)
{
con = new SqlConnection("Data Source=server;Integrated Security=SSPI;Initial Catalog=zxz;MultipleActiveResultSets=True;");
con.Open();
// SqlCommand ocmd = new SqlCommand("Spsearchordernogv", con);
SqlCommand ocmd = new SqlCommand("Order_wiseStatus_Prd_pendGV", con);
ocmd.CommandType = CommandType.StoredProcedure;
ocmd.Parameters.AddWithValue("@Order_Ref_No", Order_Ref_No);
SqlDataAdapter oda = new SqlDataAdapter(ocmd);
SqlCommandBuilder builder = new SqlCommandBuilder(oda);
DataSet ds = new DataSet();
oda.Fill(ds);
gv1.DataSource = ds;
gv1.DataBind();
con.Close();
}