void BtnEditRow_Click(object sender, RoutedEventArgs e) { MessageTemplates messageTemplate = dgvMessageTemplates.SelectedItem as MessageTemplates; if (messageTemplate == null) { return; } MessageTemplatesSaveWindow window = new MessageTemplatesSaveWindow(messageTemplate); window.ShowDialog(); }
//Дабл клик по строке таблицы - открывает окно редактирования private void DgvBid_RowDoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; MessageTemplates template = row.Item as MessageTemplates; if (template == null) { return; } MessageTemplatesSaveWindow window = new MessageTemplatesSaveWindow(template); window.ShowDialog(); viewSource.View.Refresh(); dgvMessageTemplates.CurrentCell = new DataGridCellInfo(row.Item, dgvMessageTemplates.CurrentCell.Column); }
void BtnAdd_Click(object sender, RoutedEventArgs e) { MessageTemplatesSaveWindow w = new MessageTemplatesSaveWindow(); w.ShowDialog(); }