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

Limiting number of lines in RichTextbox

9 Answers 225 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Pranay
Top achievements
Rank 1
Pranay asked on 17 Feb 2011, 11:10 AM
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

9 Answers, 1 is accepted

Sort by
0
Andrew
Telerik team
answered on 22 Feb 2011, 09:29 AM
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!
0
Todd Millett
Top achievements
Rank 1
answered on 15 Apr 2011, 11:39 AM
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. 
0
Iva Toteva
Telerik team
answered on 15 Apr 2011, 02:46 PM
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
0
Todd Millett
Top achievements
Rank 1
answered on 24 May 2011, 12:42 PM
Any updates on this, whether the bug has been resolved or any available fixes ?
0
Iva Toteva
Telerik team
answered on 26 May 2011, 03:29 PM
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
0
Todd Millett
Top achievements
Rank 1
answered on 16 Jun 2011, 08:10 AM
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
0
Iva Toteva
Telerik team
answered on 21 Jun 2011, 07:53 AM
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
0
yogesh
Top achievements
Rank 1
answered on 21 May 2015, 07:31 AM

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.

0
Petya
Telerik team
answered on 25 May 2015, 04:55 PM
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
Tags
RichTextBox
Asked by
Pranay
Top achievements
Rank 1
Answers by
Andrew
Telerik team
Todd Millett
Top achievements
Rank 1
Iva Toteva
Telerik team
yogesh
Top achievements
Rank 1
Petya
Telerik team
Share this question
or