Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1725
UltraGridDocumentExporter - Controlling Cell width and Row height
posted

I'm trying to find some samples (or better just help) in getting a grid to properly render through the document exporter.

 I have a grid with a couple of bands that I'm trying to export. My issue is that I don't seem to be able to get the contents of the cells to appear without being clipped (row height) or to be able to set a column width no matter what I do.

 I've tried setting row height and cell width properties in the grid InitializeLayout and InitializeRow evants which does not seem to have any impact. I then tried messing with things in the Exporter CellExported event, again it does not seem to make any difference in the resulting output.

I started playing with this because the exporter does not seem to handle the <br/> tag in formatted cell. So I attempted to calculate the cell height/width of the text based on using the grid font and a TextRenderer.MeasureText. This calculates a height and width but when applied to the row/cell it does not seem to  change anything. I've also (just for testing) tried to set the cell width to some fixed size, when the cell is rendered it appears to be set back to the default size of 100. So, again, I'm confused by printing/exporting support in the exporter.

Any pointers to reasonable samples or documentation would be helpful at this point.

Neil 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     Hi Neil,

        I'm pretty sure this is a known bug (regarding the </br> tags). It should be fixed in the next hot fix.

        My guess is that the settings you are applying to the grid are not honored because the UltraGridDocumentExporter auto-sizes the rows and columns in the grid by default. There's a property on the component (AutoSize, I think) so you can turn this off. But if you turn it off, it means you have to size all of the grid columns and/or rows yourself.  

Children