//When the user selects a row in the datagrid private void dgv_Reporting_SelectionChanged(object sender, SelectedCellsChangedEventArgs e) { if (Reporting.ReportingSearchControl.ResultsGrid.SelectedItem != null) { EditingReportingInfomation = (Reporting.ReportingSearchControl.ResultsGrid.SelectedItem as HR_EMP_REPORTTO).Clone() as HR_EMP_REPORTTO; } }
//This is a event which fires whenever newitems arrive at the datagrid private void ItemSourceChanged(object sender, EventArgs e) { ReportingInformation = Reporting.ReportingSearchControl.ResultsGrid.ItemsSource as ObservableCollection <HR_EMP_REPORTTO>; Reporting.ReportingGrid.DataContext = ReportingInformation; if (ReportingInformation.Count > 0) { EditingReportingInfomation = ReportingInformation[0].Clone(); } }