MeasureOverride returned positive infinity

4 posts, 1 answers
  1. Bryan
    Bryan avatar
    28 posts
    Member since:
    Jul 2008

    Posted 06 Jul 2010 Link to this post

    Not sure how to solve this one.

    As soon as I put a combo box within a toolbar it give me this error.

    "MeasureOverride returned positive infinity: Telerik.Windows.Documents.Layout.DocumentLayoutBox"

    Here is the xaml for the page.

    If I remove the combo boxes it works great. 

    <UserControl x:Class="LeadManager.Client.Controls.RichTextArea"   
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents" 
                 xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"   
                 xmlns:Controls1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"   
                 xmlns:Controls2="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikRibbonBar="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonBar" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">  
          
    <Grid x:Name="LayoutRoot" Background="White">  
            <Grid.RowDefinitions>  
                <RowDefinition Height="Auto" />  
                <RowDefinition Height="*" />  
            </Grid.RowDefinitions>  
     
            <Controls:RadToolBar HorizontalAlignment="Left" VerticalAlignment="Top">  
     
                <Controls2:RadButton  x:Name="Undo" Click="UndoClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/undo.png" 
                            ToolTipService.ToolTip="Underline the selected text." />  
                </Controls2:RadButton>  
     
                <Controls2:RadButton x:Name="Redo" Click="RedoClick"   >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/redo.png" 
                            ToolTipService.ToolTip="Underline the selected text." />  
                </Controls2:RadButton>  
     
                <Controls2:RadToggleButton   x:Name="Bold" Click="FontWeightClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/bold.png" 
                            ToolTipService.ToolTip="Make the selected text bold." />  
                </Controls2:RadToggleButton>  
     
                <Controls2:RadToggleButton x:Name="Italic" Click="FontStyleClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/italic.png" 
                            ToolTipService.ToolTip="Italicize the selected text." />  
                </Controls2:RadToggleButton>  
     
                <Controls2:RadToggleButton x:Name="Underline" Click="UnderlineClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/underline.png" 
                            ToolTipService.ToolTip="Underline the selected text." />  
                </Controls2:RadToggleButton>  
     
                <Controls2:RadToggleButton x:Name="Strikethrough" Click="StrikethroughClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/Strikethrough16.png" 
                            ToolTipService.ToolTip="" />  
                </Controls2:RadToggleButton>  
     
                <Controls2:RadToggleButton x:Name="Subscript" Click="SubscriptClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/subscript.png" 
                            ToolTipService.ToolTip="" />  
                </Controls2:RadToggleButton>  
     
                <Controls2:RadToggleButton x:Name="Superscript" Click="SuperscriptClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/superscript.png" 
                            ToolTipService.ToolTip="" />  
                </Controls2:RadToggleButton>  
     
                <Controls1:RadComboBox Name="FontCombo"  Width="135" IsEditable="True" SelectedIndex="0"   
                                        ToolTipService.ToolTip="Change the font face." 
                                       SelectionChanged="RadComboBoxSelectionChanged">  
                    <Controls1:RadComboBoxItem Content="Arial" FontFamily="Arial" />  
                    <Controls1:RadComboBoxItem Content="Arial Black" FontFamily="Arial Black" />  
                    <Controls1:RadComboBoxItem Content="Calibri" FontFamily="Calibri" />  
                    <Controls1:RadComboBoxItem Content="Comic Sans MS" FontFamily="Comic Sans MS" />  
                    <Controls1:RadComboBoxItem Content="Courier New" FontFamily="Courier New" />  
                    <Controls1:RadComboBoxItem Content="Georgia" FontFamily="Georgia" />  
                    <Controls1:RadComboBoxItem Content="Lucida Sans Unicode" FontFamily="Lucida Sans Unicode" />  
                    <Controls1:RadComboBoxItem Content="Times New Roman" FontFamily="Times New Roman" />  
                    <Controls1:RadComboBoxItem Content="Trebuchet MS" FontFamily="Trebuchet MS" />  
                    <Controls1:RadComboBoxItem Content="Verdana" FontFamily="Verdana" />  
                </Controls1:RadComboBox>  
     
                <Controls1:RadComboBox x:Name="FontSizeComboBox" IsTextSearchEnabled="False" IsEditable="True"   
                                       ToolTipService.ToolTip="Change the font size." 
                                                      Width="45" SelectedIndex="0"  SelectionChanged="FontSizeSelectionChanged">  
                    <Controls1:RadComboBoxItem Content="8" />  
                    <Controls1:RadComboBoxItem Content="9" />  
                    <Controls1:RadComboBoxItem Content="10" />  
                    <Controls1:RadComboBoxItem Content="11" />  
                    <Controls1:RadComboBoxItem Content="12" />  
                    <Controls1:RadComboBoxItem Content="14" />  
                    <Controls1:RadComboBoxItem Content="16" />  
                    <Controls1:RadComboBoxItem Content="18" />  
                    <Controls1:RadComboBoxItem Content="20" />  
                    <Controls1:RadComboBoxItem Content="22" />  
                    <Controls1:RadComboBoxItem Content="24" />  
                    <Controls1:RadComboBoxItem Content="26" />  
                    <Controls1:RadComboBoxItem Content="28" />  
                    <Controls1:RadComboBoxItem Content="36" />  
                    <Controls1:RadComboBoxItem Content="48" />  
                    <Controls1:RadComboBoxItem Content="72" />  
                </Controls1:RadComboBox>  
     
                <Controls2:RadButton x:Name="IncreaseFont" Click="IncreaseFontClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/font-increasesize.png" 
                            ToolTipService.ToolTip="Grow Font" />  
                </Controls2:RadButton>  
     
                <Controls2:RadButton x:Name="DecreaseFont" Click="DecreaseFontClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/font-decreasesize.png" 
                            ToolTipService.ToolTip="Shrink Font" />  
                </Controls2:RadButton>  
     
                <Controls2:RadButton x:Name="ClearFormattingButton" Click="ClearFormattingButtonClick" >  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/ClearFormatting16.png" 
                            ToolTipService.ToolTip="Clear Formatting" />  
                </Controls2:RadButton>  
     
                <Controls2:RadDropDownButton Name="HighlightColorSelector">  
                    <Image Width="16" Height="16" Source="/LeadManager.Client;component/Assets/Images/RichText/highlight.png" 
                            ToolTipService.ToolTip="Make text look like it was marked with a highlighter pen." />  
                    <Controls2:RadDropDownButton.DropDownContent>  
                        <Controls1:RadColorSelector x:Name="HighlightColor" NoColorVisibility="Collapsed" StandardPaletteVisibility="Collapsed"   
                                                    HeaderPaletteVisibility="Collapsed"  MainPalette="Standard"   
                                                    SelectedColorChanged="HighlightColorSelectedColorChanged" MainPaletteColumnsCount="5">  
                        </Controls1:RadColorSelector>  
                        </Controls2:RadDropDownButton.DropDownContent>  
                    </Controls2:RadDropDownButton>  
            </Controls:RadToolBar>  
     
            <telerik:RadRichTextBox x:Name="Editor" Background="White" Grid.Row="1" BorderThickness="1" />  
        </Grid>  
    </UserControl> 

  2. Answer
    Mike
    Admin
    Mike avatar
    640 posts

    Posted 08 Jul 2010 Link to this post

    Hello Bryan,

    This problem appears because currently RadRichTextBox does not support to Horizontal/Vertical stack panel or Grid Cell with Auto width/height. We will resolve this limitation in the upcoming release. You should though be careful though, when using this kind of panel with RadRichTextBox, since this way you will loose the UI virtualization 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 * size of the cells to avoid such problems.

    Let us know if the problem persists.

    Sincerely yours,
    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
  3. DevCraft banner
  4. Bryan
    Bryan avatar
    28 posts
    Member since:
    Jul 2008

    Posted 08 Jul 2010 Link to this post

    Thanks.

    Do you know how I can view the rich text control while having it adjust its height, based on its content?

    Right now I am using it store comments like a blog post comment.  When I display, the height does not adjust for the content in the control.

    Bryan

  5. Mike
    Admin
    Mike avatar
    640 posts

    Posted 14 Jul 2010 Link to this post

    Hi Bryan,

    The new version Q2 that will be live any minute now should solve this issue. You should be able to measure RadRichTextBox in a container that has infinite height.
    Let us know how it goes.

    Best wishes,
    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
Back to Top