//When the user selects a row in the datagrid void dgv_EmployeePD_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (employeepd.PDSearchControl.ResultsGrid.SelectedItem != null) { EditingEmployeePD = (employeepd.PDSearchControl.ResultsGrid.SelectedItem as HR_EMPLOYEE_PD).Clone() as HR_EMPLOYEE_PD; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { EmployeePDInformation = employeepd.PDSearchControl.ResultsGrid.ItemsSource as ObservableCollection <HR_EMPLOYEE_PD>; employeepd.EmployeePDGrid.DataContext = EmployeePDInformation; if (EmployeePDInformation.Count > 0) { EditingEmployeePD = EmployeePDInformation[0].Clone(); } }