Spreadsheet set Column width to value of double

Posted by: Jose.Aguirre on 15 August 2023, 3:34 am EST

  • Posted 15 August 2023, 3:34 am EST - Updated 15 August 2023, 4:03 am EST

    Hello,

    when I try to set the width (height) of the spreadsheet to some value, it sets only the integer part of the value, even if it is of type double:

    double GrapeCity.Windows.SpreadSheet.Data.Column.Width

    E.g.: Width = 135.666

    the result Width is 135

    How to set the double value properly? Even a pixel can not be half, so why a double…

  • Posted 16 August 2023, 3:56 am EST

    Hi,

    We are unable to replicate this behavior at our end. Width/Height are type of Double. If we set Width/Height = 135.666, then the Height/Width will be 135.666 not 135.

    Please refer the sample for the same: WpfSpreadDemo.zip

    Best Regards,

    Nitin

  • Posted 16 August 2023, 6:33 am EST

    Sorry, partially my mistake. But as also stated later, I meant:

    double GrapeCity.Windows.SpreadSheet.Data.Column.Width

    it means the width of the column

  • Posted 17 August 2023, 3:30 am EST

    Hi,

    Apologize for the inconvenience. We have replicated this issue at our end. This seems like a bug. So, we have escalated it to the development team. Will get back to you once we have any update from them.[Internal Tracking Id - SPNET-32688]

    Bets Regards

    Nitin

  • Posted 21 August 2023, 1:31 am EST

    Hi,

    As per the development team, The current behavior is by design. Because there’s an explicit cast in GetColumnWidth that truncates the width value.

    It’s unsafe to change this behavior directly. Because it will break other features. We can only add a new API to get the exact column width.

    We will let you know once the new API to fetch the exact column width will be added.

    Best Regards,

    Nitin

Need extra support?

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

Learn More

Forum Channels