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

Null error on RadDocument, CTRL+N

1 Answer 92 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Apex
Top achievements
Rank 1
Apex asked on 05 Apr 2012, 09:45 PM
Dear Telerik;

Document.LayoutMode = DocumentLayoutMode.Paged
I am using CTRL+N shortcut for new document. 
I am getting a strange this error.

But, Document.LayoutMode = DocumentLayoutMode.Flow
No error.

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Documents
  StackTrace:
       at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.GetFocusedPresenter() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPrintLayoutPresenter.cs:line 687
       at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.get_IsFocused() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPrintLayoutPresenter.cs:line 374
       at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.SetCaretBlinking(Boolean isBlinking) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPrintLayoutPresenter.cs:line 282
       at Telerik.Windows.Documents.UI.DocumentPresenterBase.<this_KeyDown>b__0() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPresenterBase.cs:line 652
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   
Thank You.

 

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 09 Apr 2012, 04:13 PM
Hi Apex,

Thank you for reporting this issue. We will review the current implementation in order to fix the problem.

In the meantime, you can workaround the issue by setting the command binding to the NewDocument command as follows:

<telerik:RadRichTextBox Grid.Row="1" Name="editor" >
    <telerik:RadRichTextBox.InputBindings>
        <KeyBinding Gesture="Ctrl+N" Command="telerikDocs:RichTextBoxCommands.NewDocument" />
    </telerik:RadRichTextBox.InputBindings>
</telerik:RadRichTextBox>

Provided that you have declared the telerikDocs namespace like this:
xmlns:telerikDocs="clr-namespace:Telerik.Windows.Documents.RichTextBoxCommands;assembly=Telerik.Windows.Documents"

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Apex
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or