title: PrintDialog.PrinterSettings not working
body: <p>I am trying to print the selected file from datagridview. This file location is saved in the database. Now before printing I want to pass "number of copies, from page &amp; to page" to the PrintDialog. I am able to pass these values to the PrintDialog, but it is not working and all the pages are being print and that too only once. I even searched a lot to find it on net but was unable to solve this.</p>
  
  <p>Please help me to print 'n' no of copies either by selecting all page option or by passing values to FromPage and ToPage. my code is :</p>
  
  <pre><code>//string ASSIGNMENT_PATH = dataGridView1.Rows[k].Cells[2].Value.ToString();
  string ASSIGNMENT_PATH = "@C:\test.docx";
  
  if (!File.Exists(ASSIGNMENT_PATH))
  {
      MessageBox.Show("No exceptional file created by application till now .");
  }
  else
  {
      short noC = Convert.ToInt16(txtNumOfCopies.Text);
      short fP = Convert.ToInt16(txtFromPage.Text);
      short tP = Convert.ToInt16(txtToPage.Text);
  
      PrintDialog dialog = new PrintDialog();
      dialog.AllowSomePages = true;
      dialog.PrinterSettings.FromPage = fP;
      dialog.PrinterSettings.ToPage = tP;
      dialog.PrinterSettings.Copies = noC;
  
      DialogResult dialogResult = dialog.ShowDialog(this);
  
      if (dialogResult == DialogResult.Cancel)
      {
          this.Close();
      }
      if (dialogResult == DialogResult.OK)
      {
          ProcessStartInfo info = new ProcessStartInfo(ASSIGNMENT_PATH);
          info.Verb = "PrintTo";
          info.Arguments = "\"" + printDialog1.PrinterSettings.PrinterName + "\"";
          info.CreateNoWindow = true;
          info.WindowStyle = ProcessWindowStyle.Hidden;
          Process.Start(info);
      }
  }
  </code></pre>