private void OnControlLoad(object sender, EventArgs e) { //Event handler for control load event this.Cursor = Cursors.WaitCursor; try { #region Grid customizations from normal layout (to support cell editing) this.grdMain.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.grdMain.DisplayLayout.Override.SelectTypeRow = SelectType.Single; this.grdMain.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdMain.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdMain.DisplayLayout.Override.AllowAddNew = RoleServiceGateway.IsBillingSupervisor ? AllowAddNew.TemplateOnBottom : AllowAddNew.No; this.grdMain.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdMain.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdMain.DisplayLayout.Override.MaxSelectedCells = 1; this.grdMain.DisplayLayout.Override.CellClickAction = CellClickAction.Edit; this.grdMain.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.Edit; this.grdMain.DisplayLayout.Bands[0].Columns["FinanceVendorID"].SortIndicator = SortIndicator.Ascending; #endregion if (!this.DesignMode) { this.uddEquipType.DataSource = FinanceGateway.GetDriverEquipmentTypes(); this.uddEquipType.DataMember = "EquipmentTypeTable"; this.uddEquipType.DisplayMember = "Description"; this.uddEquipType.ValueMember = "ID"; this.csRefresh.PerformClick(); } } catch (Exception ex) { reportError(ex); } finally { this.Cursor = Cursors.Default; } }
private void OnLoad(object sender, EventArgs e) { //Event handler for control load event this.Cursor = Cursors.WaitCursor; try { this.grdMileageRates.Visible = this.grdUnitRates.Visible = this.grdMileageRouteRates.Visible = this.grdUnitRouteRates.Visible = false; #region Grid customizations from normal layout (to support cell editing) this.grdMileageRates.UpdateMode = UpdateMode.OnRowChangeOrLostFocus & UpdateMode.OnUpdate; this.grdMileageRates.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.grdMileageRates.DisplayLayout.Override.RowFilterMode = RowFilterMode.AllRowsInBand; this.grdMileageRates.DisplayLayout.Override.SelectTypeRow = SelectType.Single; this.grdMileageRates.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdMileageRates.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdMileageRates.DisplayLayout.Override.AllowAddNew = RoleServiceGateway.IsBillingSupervisor ? AllowAddNew.TemplateOnBottom : AllowAddNew.No; this.grdMileageRates.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdMileageRates.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdMileageRates.DisplayLayout.Override.MaxSelectedCells = 1; this.grdMileageRates.DisplayLayout.Override.CellClickAction = CellClickAction.Edit; this.grdMileageRates.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.Edit; this.grdMileageRates.DisplayLayout.Bands[0].Columns["AgentNumber"].SortIndicator = SortIndicator.Ascending; this.grdUnitRates.UpdateMode = UpdateMode.OnRowChangeOrLostFocus | UpdateMode.OnUpdate; this.grdUnitRates.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.grdUnitRates.DisplayLayout.Override.RowFilterMode = RowFilterMode.AllRowsInBand; this.grdUnitRates.DisplayLayout.Override.SelectTypeRow = SelectType.Single; this.grdUnitRates.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdUnitRates.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdUnitRates.DisplayLayout.Override.AllowAddNew = RoleServiceGateway.IsBillingSupervisor ? AllowAddNew.TemplateOnBottom : AllowAddNew.No; this.grdUnitRates.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdUnitRates.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdUnitRates.DisplayLayout.Override.MaxSelectedCells = 1; this.grdUnitRates.DisplayLayout.Override.CellClickAction = CellClickAction.Edit; this.grdUnitRates.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.Edit; this.grdUnitRates.DisplayLayout.Bands[0].Columns["AgentNumber"].SortIndicator = SortIndicator.Ascending; this.grdMileageRouteRates.UpdateMode = UpdateMode.OnRowChangeOrLostFocus | UpdateMode.OnUpdate; this.grdMileageRouteRates.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.grdMileageRouteRates.DisplayLayout.Override.RowFilterMode = RowFilterMode.AllRowsInBand; this.grdMileageRouteRates.DisplayLayout.Override.SelectTypeRow = SelectType.Single; this.grdMileageRouteRates.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdMileageRouteRates.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdMileageRouteRates.DisplayLayout.Override.AllowAddNew = RoleServiceGateway.IsBillingSupervisor ? AllowAddNew.TemplateOnBottom : AllowAddNew.No; this.grdMileageRouteRates.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdMileageRouteRates.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdMileageRouteRates.DisplayLayout.Override.MaxSelectedCells = 1; this.grdMileageRouteRates.DisplayLayout.Override.CellClickAction = CellClickAction.Edit; this.grdMileageRouteRates.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.Edit; this.grdMileageRouteRates.DisplayLayout.Bands[0].Columns["AgentNumber"].SortIndicator = SortIndicator.Ascending; this.grdUnitRouteRates.UpdateMode = UpdateMode.OnRowChangeOrLostFocus | UpdateMode.OnUpdate; this.grdUnitRouteRates.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True; this.grdUnitRouteRates.DisplayLayout.Override.RowFilterMode = RowFilterMode.AllRowsInBand; this.grdUnitRouteRates.DisplayLayout.Override.SelectTypeRow = SelectType.Single; this.grdUnitRouteRates.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdUnitRouteRates.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdUnitRouteRates.DisplayLayout.Override.AllowAddNew = RoleServiceGateway.IsBillingSupervisor ? AllowAddNew.TemplateOnBottom : AllowAddNew.No; this.grdUnitRouteRates.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdUnitRouteRates.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdUnitRouteRates.DisplayLayout.Override.MaxSelectedCells = 1; this.grdUnitRouteRates.DisplayLayout.Override.CellClickAction = CellClickAction.Edit; this.grdUnitRouteRates.DisplayLayout.Bands[0].Override.CellClickAction = CellClickAction.Edit; this.grdUnitRouteRates.DisplayLayout.Bands[0].Columns["AgentNumber"].SortIndicator = SortIndicator.Ascending; #endregion if (!this.DesignMode) { this.uddAgentType.DataSource = FinanceGateway.GetLocalTerminals(); this.uddAgentType.DataMember = "LocalTerminalTable"; this.uddAgentType.DisplayMember = "Description"; this.uddAgentType.ValueMember = "AgentNumber"; this.uddEquipType.DataSource = FinanceGateway.GetDriverEquipmentTypes(); this.uddEquipType.DataMember = "EquipmentTypeTable"; this.uddEquipType.DisplayMember = "Description"; this.uddEquipType.ValueMember = "ID"; } this.csRefresh.Enabled = this.tsRefresh.Enabled = this.cboRateType.Enabled = this.mRates != null; this.cboRateType.SelectedIndex = 0; } catch (Exception ex) { reportError(ex); } finally { this.Cursor = Cursors.Default; } }