SetColumnWidth does not work

Posted by: mario-muja on 8 September 2017, 1:13 pm EST

  • Posted 8 September 2017, 1:13 pm EST


    I am using Spread for Windows Forms 2.5.

    I try to set the width of some columns to one pixel using the following code:

                    Sheets[0].ColumnHeader.Columns[columnIndex].Width = 1;

    but it does not work. Nothing happens after this statement.

    I tested the method SetColumnWidth without success.

    What do I need to do to make the sheet accept my column width setting?

    Regards, Mario

  • Replied 8 September 2017, 1:13 pm EST

    Mario -

    If you are bound then you need to set the <span id="pagetitle">DataAutoSizeColumns to False.  Otherwise this should be working.
  • Replied 8 September 2017, 1:13 pm EST

    It works as expected. My fault. There was another statement changing the width further down in my code.
Need extra support?

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

Learn More

Forum Channels