This is a migrated thread and some comments may be shown as answers.

RadTextBox: Set # of characters to wrap at

2 Answers 58 Views
Input
This is a migrated thread and some comments may be shown as answers.
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
ToltingColtAcres asked on 18 Dec 2013, 05:48 PM

I have a radtextbox which is used to enter text which is then laid out on a pdf form. The pdf form is multiline, limited to 55 characters per line.


Is there a way I can tell the radtextbox to automatically wrap at 55 characters, so what people see on the screen is more indicative of what will appear in the pdf form?





I've fiddled with hard-coding the width parameter, but this doesn't seem to work well, because people have different font sizes specified via control panel, and the control renders with different default fonts in various browsers. Unfortunately I didn't see a "WrapAt" property I could set to 55 :)



2 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 21 Dec 2013, 10:55 AM
Hello Michael,

You can use the Columns parameter of RadTextBox that renders cols in the textarea. It will be closer than setting width. But since each character has different width, it still will not force the text to be wrapped in exactly 55 chars.

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
answered on 23 Dec 2013, 12:10 PM

I did try this approach, but, like you said, due to proportional fonts I had mixed success.


Could Telerik consider adding a property in a future release to allow developers to specify the number of characters to wrap at, with a default of 0, which mimics the current behavior, I'm sure some people would find it useful, especially those of us who need to build front-ends for other systems such as I indicated in my original post.



Thanks.

Tags
Input
Asked by
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Answers by
Vasil
Telerik team
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Share this question
or