//Fill Datagrid of the ForeignKeyDropDown when it's dropped down //void CustomCombo_DropDownOpened(object sender, EventArgs e) //{ // DocumentAttributesModel.DocAttributesSearch(transaction.DocAttribLTIDropDown.SearchControl); //} //Search button of the ForeignKey drop down //public void btn_Search_Click(object sender, RoutedEventArgs e) //{ // transaction.DocAttribLTIDropDown.ResetPager(); // DocumentAttributesModel.DocAttributesSearch(transaction.DocAttribLTIDropDown.SearchControl); //} //When the user selects a row in the datagrid void dgv_ProfitLoss_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (account.ProfitLossSearchControl.ResultsGrid.SelectedItem != null) { EditingLastAccountInfo = (account.ProfitLossSearchControl.ResultsGrid.SelectedItem as FIN_ProfitLostType).Clone() as FIN_ProfitLostType; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { LastAccountInformation = account.ProfitLossSearchControl.ResultsGrid.ItemsSource as ObservableCollection <FIN_ProfitLostType>; account.ProfitLostTypeGrid.DataContext = LastAccountInformation; if (LastAccountInformation.Count > 0) { EditingLastAccountInfo = LastAccountInformation[0].Clone(); } }