Skip to content

Line breaks in WinGrid cell

New Discussion
Awesome Pawsome
Awesome Pawsome asked on Dec 4, 2015 6:33 PM

How can I get WinGrid cell to display multiple line text:

I have tried \r\n, \n and neither works.

I'm trying to get the cell to display something like the following:

Lorem ipsum dolor

Sit Amet

Consectetur

I need forced line break vs wrapping when text length exceeds certain length.

Thank you.

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on Dec 4, 2015 6:59 AM

    Hi.

    Thank you for posting in our forum.

    You need to set CellMultiLine property to true in order to show multiline text in the grid’s cells. Please note you may also should set the RowSizing of your grid to some suitable to your scenario value. More about CellMultiLine you may find by following the next link http://help.infragistics.com/Help/Doc/WinForms/2015.2/CLR4.0/html/infragistics4.Win.UltraWinGrid.v15.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~CellMultiLine.html.

    Please check also this article in our knowledge base where your question is answered http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1043.

    Please let me know if you have any further questions.

    Thank you for using Infragistics Controls.

    • 0
      Awesome Pawsome
      Awesome Pawsome answered on Dec 4, 2015 7:53 AM

      Setting the CellMultiLine property to true only works if the string value is longer than the width of the cell. 

      I'm looking to add a multiple line breaks at any given point in the string not just a wrapping feature based on the length of the string value.

      • 0
        Mike Saltzman
        Mike Saltzman answered on Dec 4, 2015 2:35 PM

        CellMultiline will wrap the text both if it's too long to fit on one line and also on any line breaks within the text. I have attached a small sample project demonstrating this working.

      • 0
        Awesome Pawsome
        Awesome Pawsome answered on Dec 4, 2015 6:33 PM

        Thank you, 

        Environment.NewLine is what I was missing.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Awesome Pawsome
Favorites
0
Replies
4
Created On
Dec 04, 2015
Last Post
10 years, 11 months ago

Suggested Discussions

Tags

Created by

Created on

Dec 4, 2015 6:33 PM

Last activity on

Dec 4, 2015 6:33 PM