private void tsbDelete_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) { try { ListID = GridListGeneral.GetFocusedRowCellValue("ListID").ToString(); BLListType.DeleteListTypeID(ListTypeID, ListID); LoadGrid(); GridListGeneral.FocusRowHandle(GridListGeneral.ReturnVisibleRowCount - 1); } catch (NullReferenceException) { MessageBox.Show("Lỗi không thể xóa được bảng trống"); } }
private void LoadGrid() { GridListGeneral.ItemsSource = BLListType.LoadListType(ListTypeID); }