I haven't been able to print the vertical grid either through a print component link or using the vgrid's .print method. The attached project opens a table from XML data and populates an XtraGrid and a vertical grid. As I scroll down the XtraGrid, the data in the vertical grid (which is in singlerecord mode) changes correctly, but when I preview the grid by clicking the Print button, the record displayed is always the one at the top of the grid and never changes. Can you tell me please how to make the preview/print work with the data displayed, rather than the first record in the table?
Thanks Andrew. After posting the question, I had a look at the Demo app for the vertical grid thinking there might be a print example there. I ran the demo and clicked the Export/Print button and selected the Print Preview option, and found that it behaves in the same way as the attached so figured it was maybe a bug.
As a workaround in the meantime (in case anybody else is having the same problem) I've changed the Preview and Print menu options in my app so that they copy the current row to a single record table and print a second, hidden vertical grid on the fly using code along the lines of:
DataTable tbl = ds.Tables.Clone();
DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
vg2.DataSource = tbl;
vg2.RowHeaderWidth = vgX.RowHeaderWidth;
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.