Assigning MultiLine value to RadTextBox.Text

3 posts, 0 answers
  1. Jakkie Esschert van den
    Jakkie Esschert van den avatar
    61 posts
    Member since:
    Sep 2009

    Posted 06 May 2010 Link to this post

    Hi,

    I've got a RadTextBox which has multiline set to true. However, when I assign a value to the Text property which contain "\n" characters all text appears on a single line. Is the Text property supposed to handle multi line texts, or do I need to set some additional properties?

  2. Jakkie Esschert van den
    Jakkie Esschert van den avatar
    61 posts
    Member since:
    Sep 2009

    Posted 10 May 2010 Link to this post

    Well, I fixed it by manually splitting the string and assigning it to the lines property.

    However, could it be that the TextBox doesn't handle "\n" but expects "\r\n" sequences?

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 12 May 2010 Link to this post

    Hello Jakkie Esschert van den,

    Thank you for writing.

    Actually, the described behavior is by design and if you want to set a multiline string to the Text property, you should use carriage return + new line sequence: "\r\n". Otherwise, you can use the Lines property. This functionality is exactly the same as the default one, which can be found in standard Microsoft TextBox control.

    Let me know if you have any other questions.

    Greetings,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top