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

Breaking Paragraph in two

1 Answer 58 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Stanescu Mihai
Top achievements
Rank 1
Stanescu Mihai asked on 16 May 2011, 11:21 AM
Hello,

      I would like to break a paragraph in two, for starters I have tried using Commands.InsertLineBreakCommand but it doesn't work.
      I have found though that I can achive this by doing:
private void InsertNewParagraph_Click(object sender, RoutedEventArgs e)
       {
           this.richTextBox.Document.Insert(" " + Environment.NewLine, new Telerik.Windows.Documents.Model.Styles.StyleDefinition());
           this.richTextBox.UpdateEditorLayout();
           this.richTextBox.Focus();
       }

My question is, isn't there a specific command which I can bind to the button command?

1 Answer, 1 is accepted

Sort by
0
Accepted
Iva Toteva
Telerik team
answered on 19 May 2011, 12:19 PM
Hi Stanescu Mihai,

InsertLineBreak inserts a line break in the paragraph, but does not break the paragraph in two.
Inserting creating a new paragraph can be done as in the code snippet you posted. There is no default command for inserting a new paragraph, but you can create a custom command, which executes the code from the snippet and bind to an instance of that command. Here is forum post we discuss a possible approach to creating custom command:
http://www.telerik.com/community/forums/silverlight/richtextbox/custom-command.aspx
I hope that helps.

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
Tags
RichTextBox
Asked by
Stanescu Mihai
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or