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?
4 Answers, 1 is accepted
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?
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.
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.
Is it not weird that radtextbox control render newline correctly while I type directly from keyboard, but when I get the Text property, I get only \n instead of \r\n, and render the text in an expected ways ?
I use radtextbox control to get multi line word, user expect to use enter to separate word. I have set this control to allow multiline and accept return (and also accept tab). When I read Text property, I only get \n for new line, with out \r.
As mentioned on other other thread, I may need \r\n to get this text shown back in correct way. The problem is, how to get \r\n from user input ?
Accessing the Text property of a RadTextBox which has a multiline text inputted by the end user will have \r\n in its value. As noted earlier in the thread, the behavior is the same as with the standard TextBox control. I am attaching a short video showing the result on my end as well as my test project. In case the issue persists please let me know how it can be reproduced.