C1FlexGrid .style.WordWrap not wrapping cell text ?

Posted by: softcomlimited on 8 September 2019, 12:06 pm EST

  • Posted 8 September 2019, 12:06 pm EST

    Hello,
    I am not sure what I am missing using the C1FlexGrid .Style.WordWrap property. When it is set to true and I narrow the column the text in the cell is not wrapping. I don't see a multiline property on the cell nor the style and I can't think of anything else.
    Thanks
    Brian
  • Marked as Answer

    Replied 8 September 2019, 3:23 pm EST

    Hello,

    Yes, you are right there is no MultiLine property in FlexGrid but you can use the AutoSizeRows method of FlexGrid in the AfterResizeColumn event handler to resize the row according to the data.

    Code snippet is given below :
    c1FlexGrid1.Styles.Normal.WordWrap = true;   
    private void C1FlexGrid1_AfterResizeColumn(object sender, RowColEventArgs e)
    {
    c1FlexGrid1.AutoSizeRows(0, 0, c1FlexGrid1.Rows.Count - 1, c1FlexGrid1.Cols.Count - 1, 0, AutoSizeFlags.None);
    }


    Please go through the sample demonstrating the same.


    Regards,
    Prabhat Sharma.
    WordWrapFlexGridDemo.zip
  • Replied 9 September 2019, 1:40 am EST

    Mr Sharma,
    Thank you very much
    Brian
Need extra support?

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

Learn More

Forum Channels