private void OnCancelAutomaticGridDataDialog(object sender, System.Windows.RoutedEventArgs e)
 {
     dialog.cancelButton.Click -= OnCancelAutomaticGridDataDialog;
     dialog.runButton.Click    -= OnRunAutomaticGridDataDialog;
     dialog.Close();
     dialog = null;
 }
 protected override void performRun(AutomaticSourcingEditorItem page)
 {
     if (validateColumns(page))
     {
         dialog = new AutomaticGridDataDialog();
         dialog.InputGridService = ApplicationManager.ControllerFactory.ServiceFactory.GetInputGridService();
         dialog.loadGrids();
         dialog.NewGridNameTextBox.Text = page.getAutomaticSourcingForm().SpreadSheet.DocumentName;
         dialog.cancelButton.Click     += OnCancelAutomaticGridDataDialog;
         dialog.runButton.Click        += OnRunAutomaticGridDataDialog;
         dialog.ShowDialog();
     }
 }