I have an Ultragrid with cells that are being used for free form text entry up to 1000 characters. The scroll bars in the cells are turned on. I have an UltragridPrintDocument set up to print the contents of the grid. When the document is printed, only the visible area of the cell prints. Is there a document property that can be set to print the full contents of the cell rather than just the visible area?
Thanks
Roger
Roger,
One way to do this would be to have each row resize itself when preparing to print; this will not affect the layout of the original grid, only the one being printed. Try the following in the grid's InitializePrint event:
private void ultraGrid1_InitializePrint(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintEventArgs e){ e.PrintLayout.Override.RowSizing = RowSizing.Free; foreach (UltraGridRow row in e.PrintLayout.Rows) row.PerformAutoSize();}
-Matt
Matt,
I understand the strategy, but I was unable to get it to work.
In my application, the grid is being used like a windows form. The grid has a single row and the columns are stacked vertically. I enabled autosizing on the grid which works fine on the entry screen when the cell is selected, but performing autosizing on the row during the initialize print doesn't have any effect. I may just have to do a Crystal Report.
I'll try duplicating what you described in a new application. If I still can't get it to work I'll contact support and send it along. I also haven't applied any Infragistics service packs since I downloaded version 3. I'll check on that as well. I'll let you know what my results are. Thanks for your help.
I am assuming that you are using row layouts in this case. Setting up my grid with row layouts, stacking my three columns on top of each other, the code I posted seemed to work fine for me. Are you sure that the RowSizing property of the grid is set to Free or AutoFree when the grid is printing (though admittedly if it's AutoFree, you shouldn't need this code anyway)? If so and this isn't working, it may be worth contacting Developer Support with a sample project so that they can check to see what is going wrong; it's possible a bug has been addressed if you don't have the latest hotfix (or even if you do), so that is also something that they would be able to determine for you.
Get Help