Limiting number of lines in RichTextbox

10 posts, 0 answers
  1. Pranay
    Pranay avatar
    1 posts
    Member since:
    Feb 2011

    Posted 17 Feb 2011 Link to this post

    We are using RichTextbox in our application.
    I want to limit the number of lines user can enter into the RichTextbox. To be more specific we want to allow user to enter text in single line without any horizontal or vertical scrollbars (similar to the textbox displayed on any search site). User should be able to enter any number of characters. We are basically using spell check feature of RichTextbox. Is there any way we can limit the number of lines in the RichTextbox?

    Thanks,
    Pranay
  2. Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 22 Feb 2011 Link to this post

    Hi Pranay,

    Thank you for using RadRichTextBox.

    As a matter of fact the best LayoutMode for your document would be FlowNoWrap, but this feature will be available in Q1(around March 15).

    However you can try a workaround with the current version. First of all if you want to limit the number of lines to only one, you can set the property AcceptsReturn="False", thus if the user hits enter nothing will happen. If you want your RadRichTextBox to look a lot like a regular TextBox you can set Width="23" and Height="120". About the FontSize, as you know we use a larger one, so if you want to change it you can set these properties: DocumentInheritsDefaultStyleSettings="True" and FontSize="12" (NOTE: FontSize will work only in conjunction with DocumentInheritsDefaultStyleSettings). To remove the scrollbars you can set: HorizontalScrollBarVisibility="Hidden" and VerticalScrollBarVisibility="Hidden". Your Document should be in Flow LayoutMode.

    If you have any other questions or concerns, please contact us again.

    Best wishes,
    Andrew
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 15 Apr 2011 Link to this post

    Is there any way to prevent the user from copying a multiline text and enter it into the RichTextBox? Actually I wanted the RichTextBox to resemble like Textbox where even if the user copies a multiline text to the textbox only the first line is visible and the rest is discarded. 
  5. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 15 Apr 2011 Link to this post

    Hello Todd Millett,

    Actually this is a bug and is being fixed as we speak. The approach we have chosen is similar to that of a TextBox. Unfortunately, the change will not make it into the service pack, but the next minor release, probably in a few weeks.

    Greetings,
    Iva
    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
  6. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 24 May 2011 Link to this post

    Any updates on this, whether the bug has been resolved or any available fixes ?
  7. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 26 May 2011 Link to this post

    Hello Todd Millett,

    The initial bug we found was fixed, but we have found some other problematic cases. All fixes will be included in the next release - the Q2, which is due in mid-July. The beta version of it is scheduled for mid-June.

    Best wishes,
    Iva
    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
  8. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 16 Jun 2011 Link to this post

    I have downloaded the radcontrols_for_silverlight_4_2011_1_0419_trail_hotfix version. Are the above discussed issues, solved in this release or atleast the single line issue
  9. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 21 Jun 2011 Link to this post

    Hello Todd Millett,

    The version you quoted (4_2011_1_0419) is actually the Q1 SP1, which was released on 19th April and does not include the fix of the bug you reported.
    You can expect the fixes in the official Q2 release in mid-July.

    All the best,
    Iva
    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
  10. yogesh
    yogesh avatar
    2 posts
    Member since:
    Mar 2014

    Posted 21 May 2015 Link to this post

    Hi,

    How to limit number of rows in TextBox if its in multi line mode. i also specified rows property still its not supported

    is there any way for it.

    Please help thanks in advance.

  11. Petya
    Admin
    Petya avatar
    975 posts

    Posted 25 May 2015 Link to this post

    Hi yogesh,

    Could you confirm that you are using RadRichTextBox from the Telerik UI for Silverlight suite, please? You mentioned a Rows property of the control, but RadRichTextBox doesn't expose such.

    Regards,
    Petya
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner