Hi,
It seems that the UltraGrid has problems keeping the display and print out consistant with the layout done in the UltraGrid Designer:
Problems On the PDF export:1. The group by row on the original grid is missing2. The columns are not resized correctly to fit in the page horizontally - it just cramped to the left side of the page. (used SizeColumnsAndRowsToContent option)
Problems on screen display:1. The column layout has been changed unexpectly - column 9 and 10 got moved to the right of column 12. The header was resized even though Runtime Label Sizing was set to false.
So my questions are:1. How to make sure the PDF export contains the group by row?2. How to resize the grid in PDF export to extend and fit horizontally on the page?3. Why does the layout changed when displaying the grid (while exporting as PDF the column position is fine) ?4. How to prevent the grid column header from resizing (e.g. only resize the actual content cell) ?
By the way, the layout was done standard view (not card view) with label position on the left, and "Keep Headers with Cells" option checked. Does anyone else experiencing the same problem? Thanks for your help!
Hi Chris,
1) No, I really don't. I'm not sure I even undertand how what you are describing is possible. You are saying that the exported PDF includes the child rows with no parent row? There's no reason I can think of why that would happen. I can't even think of a way to make that happen if you wanted it to.
2) The only thing I can think of is that the autosizing may not adjust the width of a column when CellMultiline is true in order to avoid situations where Memo fields with a lot of text become way too wide. But that doesn't sound like the case here.
4) How are you setting the DataSource of the grid? Are you calling the SetDataBindingMethod. This KB article might help:
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
Chris X said:By the way, is there any way to allow arranging the print and export layout at run-time by drag-n-drop?
You can Submit a feature request to Infragistics
1. Do you have any guess reason why it's not showing the group by row? Here are all my codes related to the export:---------------------------this->ultraGridDocumentExporter1->AutoSize = DocumentExport::AutoSize::SizeColumnsAndRowsToContent;this->ultraGridDocumentExporter1->Export(this->ultraGridDetails, save->FileName, DocumentExport::GridExportFileFormat::PDF);
private: System::Void ultraGridDocumentExporter1_BeginExport(System::Object^ sender, Infragistics::Win::UltraWinGrid::DocumentExport::BeginExportEventArgs^ e) { for each(UltraGridColumn^ c in e->Layout->Bands[1]->Columns) c->PerformAutoResize(PerformAutoSizeType::AllRowsInBand, true); }
--------------------------The BeginExport action is there because Child band will not resize correctly even after AutoSize is set.
2. Do you have any suggestions to look at any places or property I should check during debug to see why it's not working?
4. I never loaded any layout at run time, and the label is resizing. What I did tried was while the program was running, I manually adjusted the layout and saved the layout file manually using SaveAsXml() function, and then I modified the code to load the saved xml file at run time. That seems to be a temporary solution at the moment. However, I just can't get the design time layout (especially the label size) to show up on run time be itself.
5. If it's that complicated, I think it's not feasible to do it in code manually, since the layout might be changed in the future deployments.
By the way, is there any way to allow arranging the print and export layout at run-time by drag-n-drop?
Thank you very much for your time in this matter!
1. Okay, so the originalquestion was that thePDF export is not showing the GroupByRow? I don't understand why that would be. The exported document should look just like the grid. There's no reason why the GroupByRow would not show up unless you are doing something to turn off grouping in the export.
2. AutoSize should resize all columns in all bands. Again, I cannot see any reason why this would not work.
3. Okay.
4. Without knowing why the label is resizing, I can't really guess who to fix it. Maybe you are losing your design-time layout at run-time because you are loading a layout? That's just a wild guess.
5. In RowLayout mode, this can be tricky. There's a complex interaction between several properties like the Width of the column and properties on the LayoutInfo of the column like PreferredSize and WeightX.
Mike,
1. From the UltraGrid Display Result on the right, on top of the columns you will see a blue text "Friday January 22, 2007 - 1 Record" with an expended row expender next to it. That's the group by row I'm refering to.
2. After setting the AutoSize property, I'm now managed to get the parent table resized correctly, but the child table is still not being resized. Are you able to reproduce this issue?
3. Thanks, I'll give that a try.
4. I was able to make the lable smaller in the designer, but when it was displayed on the screen (and for print out as well), the lable got resized automatically. Is there any way to keep the label from resizing?
5. Can you provide a small sample code showing how to manually set the width of the column?
Thanks and sorry for the confusion on the questions!
1) All I see in this image are column headers. Where is there a GroupByRow?
2) The AutoSize property on the UltraGridDocumentExporter auto-sizes all of the cells and rows by default so they will fit the contents. If this is not working, it's a bug and you should Submit an incident to Infragistics Developer Support
3) Yes, you would have to copy all the properties of the original column to the new column. Mainly the LayoutInfo properties on the column.
4) I don't understand what you are asking here. You say you made the labels smaller than the cells and you appear to be asking how to make the labels smaller, which you have already done. You just click and drag the edge of the label in the designer.