title: How can I show a dialog and capture the response
body: <pre><code>private void ShowIterationSelection()
  {
      IterationForm iterationForm = new IterationForm(lblProjectID.Text);
      iterationForm.ShowDialog();
  }
  </code></pre>
  
  <p>When I show the dialog it displays a list of iterations associated with the project using the ProjectID:</p>
  
  <pre><code>public partial class IterationForm : Form
  {
      public IterationForm(string projectID)
      {
          InitializeComponent();
          LoadIterationsForProject(projectID);
      }
  
      private void LoadIterationsForProject(string projectID)
      {
          IterationRepository iterationRepo = new IterationRepository();
          Int64 ID = Convert.ToInt64(projectID);
          dgvIterations.DataSource = iterationRepo.FindAllIterations().Where(i =&gt; i.IDProject == ID).Select(i =&gt; new { Codigo = i.ID, Descripcion = i.Description, Inicio = i.StartDate, Fin = i.EndDate });
      }
  }
  </code></pre>
  
  <p>My question is, how can I capture the selected value from the datagrid view and pass it my calling form to open another form with the select IterationID?</p>
  
  <p>Thanks for the help.</p>
  
  <p>So maybe something like:</p>
  
  <pre><code>private void ShowIterationSelection()
  {
      IterationForm iterationForm = new IterationForm(lblProjectID.Text);
      var result = iterationForm.ShowDialog();
      showTheThing(result); //this uses the iterationID
  }
  </code></pre>