private void btn_capnhat_Click(object sender, EventArgs e) { DataRowView r = (DataRowView)creComboBox1.SelectedItem; services.UpdateCategory(r.Row[0].ToString(), StaticClass.storeId, txtMota.Text); txtMota.Enabled = true; txtMota.SelectionStart = 0; txtMota.Focus(); txtMota.SelectionLength = txtMota.Text.Length; catagries = services.GetAllCategories(StaticClass.storeId); limit = catagries.Rows.Count - 1; for (int i = 0; i < catagries.Rows.Count; i++) { if (catagries.Rows[i][0].Equals(txtMa.Text)) { currentIndex = i; break; } } dataBinding(); creComboBox1.SelectedIndex = currentIndex; }