private async void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { tbl_DaiLi obj = tblDaiLiBindingSource.Current as tbl_DaiLi; if (obj != null) { using (CapNhat.AddaiLy frm = new CapNhat.AddaiLy(obj)) { if (frm.ShowDialog() == DialogResult.OK) { try { tblDaiLiBindingSource.EndEdit(); await ds.SaveChangesAsync(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Lỗi Dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } }
public AddaiLy(tbl_DaiLi obj) { InitializeComponent(); tblDaiLiBindingSource.DataSource = obj; }