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
914
Using AutoWith with an IGridColumn
posted

I expected that setting the width of all IGridColumns of an IGrid to Infragistics.Documents.Report.AutoWidth.Instance would size the column widths according to the contained text. But it appears to render no differently than if I set all columns to the same relative width. There appears to be no IGrid property to get the columns after all the rows are added in case the 'AutoWidth' needs to be set for a column after the cell text is added. So is AutoWidth supposed to function?

Parents
  • 469350
    Suggested Answer
    Offline posted

    I'm not entirely sure, but in my experience, AutoWidth is not related to the contents of the object it's related to the parent of that object. So it basically fills the remaining space in the parent object, I think.

    I could be wrong about that, but I am fairly certain there is no way to measure text or the contents of a column and auto-size the width built-in to the Documents engine. What the UltraGridDocumentExporter does is measure the contents of the strings as they would be on-screen, and then gets that width and uses the PixelsToPoints method.

Reply Children