RadTextBox: Set # of characters to wrap at

3 posts, 1 answers
  1. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 18 Dec 2013 Link to this post

    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. Answer
    Vasil avatar
    1547 posts

    Posted 21 Dec 2013 Link to this post

    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.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 23 Dec 2013 Link to this post

    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.


Back to Top