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

Unhandled Exception MeasureOverride

5 Answers 145 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Andrea Ferrari
Top achievements
Rank 1
Andrea Ferrari asked on 28 May 2010, 07:38 AM
Hi,
I'm trying to use the RichTextBox editor, but when I add the followind code

<telerikEditor:RadRichTextBox Grid.Row="1" x:Name="editor" CurrentSpanStyleChanged="Editor_CurrentSpanStyleChanged" CurrentParagraphStyleChanged="Editor_CurrentParagraphPropertyChanged"
the Layout disappears with the following error:

 

MeasureOverride returned positive infinity: Telerik.Windows.Documents.Layout.ParagraphLayoutBox  
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\LayoutElement.cs:line 1735  
   at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\SectionLayoutBox.cs:line 113  
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\LayoutElement.cs:line 1812  
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\LayoutElement.cs:line 1724  
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\DocumentLayoutBox.cs:line 205  
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\LayoutElement.cs:line 1812  
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\Layout\LayoutElement.cs:line 1724  
   at Telerik.Windows.Documents.UI.EditorContentPresenter.MeasureOverride(Size availableSize) in c:\Users\TeamFoundationUser\AppData\Local\Temp\WPF_Scrum\Documents_SL_2010_Q1\Sources\Development\Documents\UI\EditorContentPresenter.cs:line 962  
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)  
 
 


What I've to do?

Thanks and regards.
Andrea Ferrari

5 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 28 May 2010, 04:39 PM
Hi Andrea Ferrari,

Thank you for reporting this issue.
In the CTP version RadRichTextBox can not be added to Horizontal/Vertical stack panel or in Grid cell that has Auto size, which is most probably the problem in your case. In the next version we will make sure this is not an issue. However, you should be careful when using this kind of panel with RadRichTextBox, since this way you will loose the UI visualization support, which may lead to poor performance and large memory footprint of your application when editing larger documents.

We suggest you use the grid panel and specify exact, *, or maximum size of the cells to avoid such problems.
Let us know if we can help any further with this issue.

Greetings,
Mike
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.
0
Bob
Top achievements
Rank 1
answered on 27 Jun 2011, 03:37 PM
Is this still an issue? I'm getting this kind of error in Blend now in the design view with our control that has a RadRichTextBox in it.

An Exception was thrown
InvalidOperationException: MeasureOverride returned NzN: Telerik.Windows.Documents.Layout.ParagraphLayoutBox


And ours is in a Grid Row with a height of star.

Right now the only way to work in Blends design view is to set the Visibility of the RadRichTextBox to Collapsed.
0
Boby
Telerik team
answered on 30 Jun 2011, 01:22 PM
Hi Bob,
We cannot reproduce the exception in Blend. Could you please open a support ticket and send us attached a sample project that reproduces the issue?

Regards,
Boby
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
0
Bob
Top achievements
Rank 1
answered on 18 Jul 2011, 04:23 PM
Don't think I can do a sample due to time constraints. Is there a better way to get more info out of the Blend error message you think, if it's getting this NaN measuring issue?
0
Boby
Telerik team
answered on 21 Jul 2011, 09:30 AM
Hi Bob,
We still cannot reproduce the exception. If you manage to find more info about it, or find a stable procedure for reproducing it, please get back to us again.

All the best,
Boby
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
RichTextBox
Asked by
Andrea Ferrari
Top achievements
Rank 1
Answers by
Mike
Telerik team
Bob
Top achievements
Rank 1
Boby
Telerik team
Share this question
or