void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e) { if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove) { objMaster = new BookingGroupBO(); try { objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt()); if (objMaster.Current != null) { objMaster.Delete(objMaster.Current); } } catch (Exception ex) { if (objMaster.Errors.Count > 0) { ENUtils.ShowMessage(objMaster.ShowErrors()); } else { ENUtils.ShowMessage(ex.Message); } e.Cancel = true; } } }
private void InitializeConstructor() { objBookingGroupMaster = new BookingGroupBO(); this.SetProperties((INavigation)objBookingGroupMaster); FillCombo(); }
public frmBookingGroupsList() { InitializeComponent(); this.Load += new EventHandler(frmLocationList_Load); grdLister.CellDoubleClick += new GridViewCellEventHandler(grdLister_CellDoubleClick); grdLister.RowsChanging += new Telerik.WinControls.UI.GridViewCollectionChangingEventHandler(Grid_RowsChanging); objMaster = new BookingGroupBO(); this.SetProperties((INavigation)objMaster); grdLister.ShowRowHeaderColumn = false; this.Shown += new EventHandler(frmLocationList_Shown); grdLister.CommandCellClick += new CommandCellClickEventHandler(grid_CommandCellClick); this.FormClosed += new FormClosedEventHandler(frmBookingGroupsList_FormClosed); }