Cannot get wordwrap to work properly.

Posted by: pshinohara on 8 September 2017, 12:51 pm EST

  • Posted 8 September 2017, 12:51 pm EST


    I cannot seem to get my text in a cell to word wrap using the following code:


    this.fpSpread1.ActiveSheet.RowCount += 1;


    this.fpSpread1.ActiveSheet.ColumnCount = 3;


    FarPoint.Win.Spread.CellType.TextCellType TextType = new FarPoint.Win.Spread.CellType.TextCellType();


    this.fpSpread1.ActiveSheet.Cells[0, 0].Text = "The big brown fox jumped over the lazy dog.";


    this.fpSpread1.ActiveSheet.Columns[0].Width = 100;


    TextType.WordWrap = true;


    this.fpSpread1.ActiveSheet.Columns[0].CellType = TextType;


    fpSpread1.ActiveSheet.SetRowHeight(0, (int)fpSpread1.ActiveSheet.Rows[0].GetPreferredHeight());


    What happens is that the text shows up but no wordwrap & I cannot see all of the text.


    Anything bad or missing here?

  • Replied 8 September 2017, 12:51 pm EST

    Are you using Spead Win 3.0.2005.2005?
  • Replied 8 September 2017, 12:51 pm EST

    yes - v3.0.2003.2005
  • Replied 8 September 2017, 12:51 pm EST

    This code worked for me with the current patch on our web site.
  • Replied 8 September 2017, 12:51 pm EST

    I assume you copied & pasted my example code & ran that.  Was this an issue with a previous  version?  If so, before I installed the latest version, I did not attempt to remove the previous one.  Just wondering if that was an issue or not.


    Also, before I installed the latest version, I was also having the problem.


     


     

  • Replied 8 September 2017, 12:51 pm EST

    There was a bug involving this method that was fixed in the last patch. I did use this code to test this (except for rowcount and columncount).  You do not need to remove the previous version.  You would just need to update your references and the toolbox.
Need extra support?

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

Learn More

Forum Channels