I'm using the PrintDialog class with UltraGridPrintDocument.
The PrintDialog has a Page Range section with All, Selection, Current Page, and Pages options.
They are all disabled except for All. I would like to give users the ability to print a range of pages. Are there any sample programs that do this? Any help would be appreciated.
Inside your button_Click...
UltraGridPrintDocument doc = new UltraGridPrintDocument(); doc.Grid = ultraGrid1; PrintDialog printDialog1 = new PrintDialog() printDialog1.AllowSomePages = true; // This is key printDialog1.Settings = doc.Settings; if(printDialog1.ShowDialog() == DialogResult.OK) { doc.Print(); }
The only gotcha here is that there is no presentation of what 'valid' page ranges are. if you select page 1000, then you're going to get the 'last' page.