private FIN_CostCenter EditingCostCenter; //Stores what we're editing right now, Incase we need to cancel the edit public CostCenterModel(CostCenter costcenter) { this.costcenter = costcenter; costcenter.CCSearchControl.Search = Search; costcenter.CCSearchControl.ResultsGrid.SelectedCellsChanged += dgv_CostCenter_SelectionChanged; costcenter.CostCenterGrid.SourceUpdated += CostCenterGrid_SourceUpdated; //This is a event which fires whenever newitems arrive at the datagrid var dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGrid)); if (dpd != null) { dpd.AddValueChanged(costcenter.CCSearchControl.ResultsGrid, ItemSourceChanged); } Search(costcenter.CCSearchControl); //Initial Search to fill datagrid with values at startup }
private FIN_CostCenterwiseConfiguration EditingCostCenterwiseConfiguration; //Stores what we're editing right now, Incase we need to cancel the edit public CostCenterwiseConfigurationModel(CostCenter costcenter) { this.costcenter = costcenter; //-------------------------------------------------------------------------------------------------- costcenter.CCwCCDropDown.Search = CostCenterModel.Search; costcenter.BCCDropDown.Search = CurrencyModel.Search; costcenter.AANDropDown.Search = GeneralLedgerAccountModel.Search; costcenter.ACCDropDown.Search = CostCenterModel.Search; costcenter.ACurrCDropDown.Search = CurrencyModel.Search; costcenter.APCCCDropDown.Search = CostCenterModel.Search; costcenter.DCfIDropDown.Search = DocumentAttributesModel.Search; costcenter.TCfIDropDown.Search = DocumentAttributesModel.Search; costcenter.DCfRPDropDown.Search = DocumentAttributesModel.Search; costcenter.TCfRPDropDown.Search = DocumentAttributesModel.Search; costcenter.DCfRGLDropDown.Search = DocumentAttributesModel.Search; costcenter.TCfGRLDropDown.Search = DocumentAttributesModel.Search; costcenter.BGLAfRPDropDown.Search = GeneralLedgerAccountModel.Search; costcenter.BCCfRPDropDown.Search = CostCenterModel.Search; costcenter.BCuCfRPDropDown.Search = CurrencyModel.Search; costcenter.PNLACfRPDropDown.Search = GeneralLedgerAccountModel.Search; costcenter.PNLCCfRPDropDown.Search = CostCenterModel.Search; costcenter.PNLCuCfRPDropDown.Search = CurrencyModel.Search; costcenter.DBTACfRPDropDown.Search = GeneralLedgerAccountModel.Search; costcenter.DBTCCfRPDropDown.Search = CostCenterModel.Search; costcenter.DBTCuCfRPDropDown.Search = CurrencyModel.Search; costcenter.CRDACfRPDropDown.Search = GeneralLedgerAccountModel.Search; costcenter.CRDCCfRPDropDown.Search = CostCenterModel.Search; costcenter.CRDCuCfRPDropDown.Search = CurrencyModel.Search; //-------------------------------------------------------------------------------------------------- costcenter.CCwCSearchControl.Search = Search; costcenter.CCwCSearchControl.ResultsGrid.SelectedCellsChanged += dgv_CostCenterwiseConfiguration_SelectionChanged; costcenter.CostCenterwiseConfigurationGrid.SourceUpdated += CostCenterwiseConfigurationGrid_SourceUpdated; //This is a event which fires whenever newitems arrive at the datagrid var dpd = DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, typeof(DataGrid)); if (dpd != null) { dpd.AddValueChanged(costcenter.CCwCSearchControl.ResultsGrid, ItemSourceChanged); } Search(costcenter.CCwCSearchControl); //Initial Search to fill datagrid with values at startup }