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

Left/Right Indent not working as expected

0 Answers 89 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 1
Nikola asked on 03 Aug 2015, 01:32 PM

Hello,

I have a RadRichTextbox control with an inserted table.

Into this table I insert a new custom user control which is an InlineUIContainer with my custom control as a content.

This InlineUIContainer is put in a new Paragraph which is put in the RadRichTextbox as follows:

"editor.Document.Sections.First.Blocks.AddAfter(paragraphBox.AssociatedParagraph, paragraph);​"

 

Then when I try to set an Indent(left or right) I got an exception message ("Null reference exception" or "The element is already a child of another element")

Here are the exception details:

{System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.Commands.Styles.Paragraphs.ChangeParagraphStyleCommandBase`2.PreserveStateBeforeExecute(TContext context)
   at Telerik.Windows.Documents.Commands.UndoableDocumentCommandBase`1.OnExecuting(DocumentCommandContextBase context)
   at Telerik.Windows.Documents.Commands.DocumentCommandBase`1.Execute(DocumentCommandContextBase context)
   at Telerik.Windows.Documents.Model.RadDocumentEditor.ChangeParagraphLeftIndent(Double leftIndent)
   at Telerik.Windows.Controls.RadRichTextBox.ChangeParagraphLeftIndent(Double leftIndent)
   at Telerik.Windows.Controls.RichTextBoxUI.RadRichTextBoxRulerController.SetSeparatorFirstLineIndentAndHangingIndent(Double firstLineIndent, Double hangingIndent)
   at Telerik.Windows.Controls.RichTextBoxUI.DocumentRulerBase.LeftIndent_DragCompleted(Object sender, DragCompletedEventArgs e)
   at Telerik.Windows.Controls.RichTextBoxUI.RulerThumb.RaiseDragCompleted(Boolean canceled)
   at Telerik.Windows.Controls.RichTextBoxUI.RulerThumb.OnLostMouseCapture(MouseEventArgs e)
   at System.Windows.Controls.Control.OnLostMouseCapture(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}

 

 

Any idea of how to repair this behaviour?

 

Thanks!

No answers yet. Maybe you can help?

Tags
RichTextBox
Asked by
Nikola
Top achievements
Rank 1
Share this question
or