title: DataGrid Values not updating after the Edit/Update function
body: <p>I am using the following code to update the data in my datagrid. </p>
  
  <p>But when I click update the value is updated in the database but it still shows old value in datagrid.</p>
  
  <p>If I refresh the page after that then datagrid shows the updated value. </p>
  
  <p>What could be wrong?</p>
  
  <p><strong>Code On Update Command:</strong>     </p>
  
  <pre><code>protected void MySQLDataGrid2_UpdateCommand(object source, DataGridCommandEventArgs e)
  {
        string newData;
  
        TextBox aTextBox;
        aTextBox = (TextBox)(e.Item.Cells[0].Controls[0]);
        newData = aTextBox.Text;
  
        decimal comm = Convert.ToDecimal(newData);
  
        string UpdateHiveCommission = "Update tbl_HiveCommission set Commission = '" + Convert.ToDecimal(newData) + "'";
        MySqlConnection objMyCon3 = new MySqlConnection(strProvider);
        objMyCon3.Open();
        MySqlCommand cmd3 = new MySqlCommand(UpdateHiveCommission, objMyCon3);
        cmd3.ExecuteNonQuery();
        objMyCon3.Close();
  
        MySQLDataGrid2.EditItemIndex = -1;
        MySQLDataGrid2.DataBind();
  }
  </code></pre>