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
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.
Andrew
the Telerik team
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
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
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.
Iva
the Telerik team
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.
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