//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_NonCashBenefit_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (benefit.NonCashBenefitSearchControl.ResultsGrid.SelectedItem != null) { EditingLastBenefitInfo = (benefit.NonCashBenefitSearchControl.ResultsGrid.SelectedItem as HR_NONCASH_BENEFIT).Clone() as HR_NONCASH_BENEFIT; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { LastBenefitInformation = benefit.NonCashBenefitSearchControl.ResultsGrid.ItemsSource as ObservableCollection <HR_NONCASH_BENEFIT>; benefit.NonCashBenefitGrid.DataContext = LastBenefitInformation; if (LastBenefitInformation.Count > 0) { EditingLastBenefitInfo = LastBenefitInformation[0].Clone(); } }