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

How to scroll up to the next new line automatically

4 Answers 74 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
DQ
Top achievements
Rank 1
DQ asked on 19 Jul 2012, 05:34 PM
Hi All,

I am using the RadRichTextBox.  The problem is that when users press enter at the last line at the bottom of the panel during editing, the next new line does not scroll up automatically.  He/she must - painfully - use the scroll bar to make the text line scroll up, and then editing. 

How do I make the next newly line scroll up automatically?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 20 Jul 2012, 03:43 PM
Hi DQ,

You can programmatically chose where the caret is and where the document is. This link will show you how to position the control in the way you want it to.

Also, while you're in the documentation, notice the expanded RichTextBox tree in the left pane. You'll find that will come in handy for any future issues you may have or as a resource for example code and guidance.

Good Luck,
Lancelot
0
Martin Ivanov
Telerik team
answered on 24 Jul 2012, 12:28 PM
Hi DQ,

What we could add to Lancelot's reply is that we have not been able to reproduce the problem you have described. You can indeed use the methods of the editor to adjust the caret position and the viewport should follow the caret. In addition, you can use the method of the editor ScrolltToVerticalOffset, but this is normally not needed.

Can you please be more descriptive about your issue:
  • can you reproduce the same behavior in the online demo?
  • in what container have you placed the RadRichTextBox?
  • send us code reproducing the problem.

All the best,
Martin
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
DQ
Top achievements
Rank 1
answered on 25 Jul 2012, 08:31 PM
Hi Martin,

No, I can't make it happen on the online demo,  but I can make it happen on my machine here.  If I don't specify the width and the height of the parent object (which is another user defined control ), the RadRichTextBox seems to lost track of the panel coordination and dice things happen.

Anyway, I specified the width and the height (statically in the xaml), and it works the way I want now.

Thanks.
0
Martin Ivanov
Telerik team
answered on 26 Jul 2012, 01:34 PM
Hi DQ,

We are glad that you found a solution to the problem. If the containing control has infinite height or width, RadRichTextBox will not work properly. For example nesting the control in scroll viewer produces such issues.

Don't hesitate to contact us if you have other questions.

Kind regards,
Martin
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
DQ
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Martin Ivanov
Telerik team
DQ
Top achievements
Rank 1
Share this question
or