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