GetPrefferedHeigth method on ColumnHeaders shows more space than needed

Posted by: agleon on 20 March 2019, 8:41 pm EST

    • Post Options:
    • Link

    Posted 20 March 2019, 8:41 pm EST - Updated 30 September 2022, 4:57 am EST

    Hi,

    I have a problem when setting the height of the first row of the column header in my spread control.

    The row contains multiple columns, each cell with multiple lines and word wrap enabled since the width is fixed (also calculated by using TextMeasure because I get the same problem with the columns width).

    I have tried this:

    MySpread.ActiveSheet.ColumnHeader.Rows(0).Height = MySpread.ActiveSheet.ColumnHeader.Rows(0).GetPreferredHeight()

    but this gives more padding to the cells even for the one containing the longest text.

    Note that our version of Spread.NET is 6.0.2005.2008 because its an old project that we are porting to VB.NET but client hasn’t updated yet to a more recent version of the library.

    Below I have attached a picture of the actual result and what the client wants.

    How can I remove the blue zones and get only the minimum size for the text displayed in the cell?

    Thanks.

  • Posted 21 March 2019, 4:03 pm EST

    Hello,

    This was a bug in older versions of Spread and it has been fixed now in latest release given below:-

    https://www.grapecity.com/en/download/spreadnet

    Unfortunately, we don’t have any workaround to be used for older version. Hence, in order to get this issue fixed, you need to upgrade your applicaiton to latest version and you will benefit more from the latest version and you will get a lot more new features and further bug fixing will be done in latest release only.

    Thanks,

    Reeva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels