//When the user selects a row in the datagrid private void dgv_CurrencyExchangeRate_SelectionChanged(object sender, SelectedCellsChangedEventArgs e) { if (Currency.CurrencyExchangeRateSearchControl.ResultsGrid.SelectedItem != null) { EditingCurrencyExchangeRateInfomation = (Currency.CurrencyExchangeRateSearchControl.ResultsGrid.SelectedItem as FIN_CurrencyExchangeRate).Clone() as FIN_CurrencyExchangeRate; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { CurrencyExchangeRateInformation = Currency.CurrencyExchangeRateSearchControl.ResultsGrid.ItemsSource as ObservableCollection <FIN_CurrencyExchangeRate>; Currency.CurrencyExchangeRateGrid.DataContext = CurrencyExchangeRateInformation; if (CurrencyExchangeRateInformation.Count > 0) { EditingCurrencyExchangeRateInfomation = CurrencyExchangeRateInformation[0].Clone(); } }