//When the user selects a row in the datagrid private void dgv_AccountType_SelectionChanged(object sender, SelectedCellsChangedEventArgs e) { if (account.AccountTypeSearchControl.ResultsGrid.SelectedItem != null) { EditingLastAccountInfo = (account.AccountTypeSearchControl.ResultsGrid.SelectedItem as FIN_AccountType).Clone() as FIN_AccountType; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { LastAccountInformation = account.AccountTypeSearchControl.ResultsGrid.ItemsSource as ObservableCollection <FIN_AccountType>; account.AccountTypeGrid.DataContext = LastAccountInformation; if (LastAccountInformation.Count > 0) { EditingLastAccountInfo = LastAccountInformation[0].Clone(); } }