//******************************************************************* // DESCRIPTION: Runs when a row of Report datagrid is double-clicked. This pulls the data from that row and opens an AddEditRecord window, // passing that data along in the constructor so it can auto-populate upon loading. // Also passes this window itself to that form, so that this EditRecord Window can update once the status is edited, // as well as PBS DataRowView. //******************************************************************* private void Report_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { DataGrid dg = (DataGrid)sender; DataRowView dataRow = dg.SelectedItem as DataRowView; if (dataRow != null) { //Pass this window, priorBySystem DataRowView, and the DataRowView that was generated from the double-click to a new AddEditStatus window EditRecord_AddEditStatus editStatus = new EditRecord_AddEditStatus(this, priorBySystemRow, dataRow); editStatus.Show(); editStatus.Topmost = true; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
// Passes this Window and prioritization by system row to a new AddEditStatus window, then displays it. private void AddStatusButton_Click(object sender, RoutedEventArgs e) { EditRecord_AddEditStatus addStatus = new EditRecord_AddEditStatus(this, priorBySystemRow); addStatus.Show(); }