//Fill Datagrid of the ForeignKeyDropDown when it's dropped down //When the user selects a row in the datagrid void dgv_AccountSubType_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (account.AccountSubTypeSearchControl.ResultsGrid.SelectedItem != null) { EditingAccountInfo = (account.AccountSubTypeSearchControl.ResultsGrid.SelectedItem as FIN_AccountSubType).Clone() as FIN_AccountSubType; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { LastAccountInformation = account.AccountSubTypeSearchControl.ResultsGrid.ItemsSource as ObservableCollection <FIN_AccountSubType>; account.AccountSubTypeGrid.DataContext = LastAccountInformation; if (LastAccountInformation.Count > 0) { EditingAccountInfo = LastAccountInformation[0].Clone(); } }