Hi,
Can you please let me know if this is possible in grid printing.
I have a grid with 8 columns. There is just one row in the grid .Due to the text size and width of the columns the grid prints 5 columns in page 1 and 3 columns in page 2.
I would like to print 5 columns, followed by the other 3 columns on the same page . This would help in not seeing much of white spaces between the 2 pages, as there is just one row of data and the grid can as well use the space left behind in page 1.
Output currently is
Page 1
column 0 column1 column2 column3 column4
-------------data------data------data------
Page 2
column5 column6 column7
---data------data------data------
Expected output
--data------data------data------
Thank you.
Based on our phone conversation I will look into this question.
It looks like there needs to be a modification to the code based on your layout design
Your image indicates that the columns are actually positioned
(3 columns over 3 columns over 2 columns)
And I think Mike assumed that you expected there to be 5 columns over 3 columns
Marianne
Hi ,
Please see the attachment for current ouput (grid1) and expected output (grid2)
Mike thanks for your sample . However when I print, I see that all the column header are placed atop each other followed by cell data. However I want column header to be placed atop of cell data then again column header atop of next cell data.
Please see the attachment. The current display of data is of grid 1 in attachment. However I would like to format the data so that the information is displayed as in grid 2 of the same attachment.
Can you please let me know the components that affect this , also any sample data will be of use.
The grid can't automatically wrap a row onto a page.
But if you know how many columns fit on a page, you could adjust the layout of your grid so that the columns in the row are one atop the other using either Groups and Levels or RowLayouts.
You can do this on the print layout which is passed into the InitializePrint or InitializePrintPreview events so that it does not affect the layout of the on-screen grid.
Setting up a RowLayout at run-time can be pretty tricky if you are not already familiar with GridBagLayouts. So here's some sample code.
private void ultraGrid1_InitializePrintPreview(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e) { UltraGridBand band = e.PrintLayout.Bands[0]; band.RowLayoutStyle = RowLayoutStyle.ColumnLayout; // Columns 0 through 4 are fine where they are, so we don't need to do anything to them. // Adjust columns 5-7 so they are under 0-2. for (int i = 5; i < 8; i++) { UltraGridColumn columnInTopRow = band.Columns["Column " + (i - 5).ToString()]; UltraGridColumn columnUnderneath = band.Columns["Column " + i.ToString()]; columnUnderneath.RowLayoutColumnInfo.OriginX = columnInTopRow.RowLayoutColumnInfo.OriginXResolved; columnUnderneath.RowLayoutColumnInfo.SpanX = columnInTopRow.RowLayoutColumnInfo.SpanXResolved; columnUnderneath.RowLayoutColumnInfo.OriginY = columnInTopRow.RowLayoutColumnInfo.OriginYResolved + columnInTopRow.RowLayoutColumnInfo.SpanYResolved; } }