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

    <FONT size=2>

    I cannot seem to get my text in a cell to word wrap using the following code:</FONT><FONT color=#0000ff size=2></FONT>

    <FONT color=#0000ff size=2>this</FONT><FONT size=2>.fpSpread1.ActiveSheet.RowCount += 1;</FONT>

    <FONT color=#0000ff size=2>this</FONT><FONT size=2>.fpSpread1.ActiveSheet.ColumnCount = 3;

    FarPoint.Win.Spread.CellType.</FONT><FONT color=#2b91af size=2>TextCellType</FONT><FONT size=2> TextType = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> FarPoint.Win.Spread.CellType.</FONT><FONT color=#2b91af size=2>TextCellType</FONT><FONT size=2>();

    </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>.fpSpread1.ActiveSheet.Cells[0, 0].Text = </FONT><FONT color=#a31515 size=2>"The big brown fox jumped over the lazy dog."</FONT><FONT size=2>;

    </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>.fpSpread1.ActiveSheet.Columns[0].Width = 100;

    TextType.WordWrap = </FONT><FONT color=#0000ff size=2>true</FONT><FONT size=2>;

    </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>.fpSpread1.ActiveSheet.Columns[0].CellType = TextType;

    fpSpread1.ActiveSheet.SetRowHeight(0, (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)fpSpread1.ActiveSheet.Rows[0].GetPreferredHeight());</FONT>

    <FONT size=2>What happens is that the text shows up but no wordwrap & I cannot see all of the text.</FONT>

    <FONT size=2>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