Telerik Forums
UI for WPF Forum
1 answer
244 views
Hi,

I need to display the rad panel bar with an expandable button, but not with an arrow. I want to have an button image instead of default arrow. I have attached the sample image of it.

Kindly help me in acheiving this.

Thanks,
Subash
Pavel R. Pavlov
Telerik team
 answered on 09 Jan 2013
8 answers
491 views
Hi, i have recently switched to 2012 Q3 and now the view  throws an Exception when loading the radgridview in the UI. Any ideas? 

Thanks in advance.

View : 

    <telerik:RadGridView x:Name="dg1"
     Grid.Row="1" Grid.ColumnSpan="2"
                                     ColumnWidth="*" UseLayoutRounding="False"
                                     ItemsSource="{Binding FilterView}"
                                     SelectionMode="Extended"
                                     SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                     AutoGenerateColumns="False" Margin="5" ShowGroupPanel="False"
                                     RowIndicatorVisibility="Collapsed"
                                     CanUserDeleteRows="False"
                                     CanUserFreezeColumns="False"
                                     CanUserInsertRows="False"
                                     IsReadOnly="True"
                                     IsFilteringAllowed="False">

                    <i:Interaction.Behaviors>
                        <Behaviors:RadGridViewMultiSelectorBehavior
                            SelectedItems="{Binding SelectedItems, Mode=TwoWay}" />
                    </i:Interaction.Behaviors>

                    <telerik:RadGridView.InputBindings>
                        <MouseBinding Gesture="LeftDoubleClick" Command="{Binding Edit}" />
                    </telerik:RadGridView.InputBindings>
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="{loc:Localize name, STV}" Width="*"
                                                    DataMemberBinding="{Binding Name}" />
                        <telerik:GridViewDataColumn Header="{loc:Localize type, STV}" Width="*"
                                                    DataMemberBinding="{Binding WorkflowInfo.DisplayName, Converter={StaticResource LocalizationConverter}, ConverterParameter=STV}" />
                        <telerik:GridViewDataColumn Header="{loc:Localize created, STV}"
                                                    DataMemberBinding="{Binding DateCreated, StringFormat='d', ConverterCulture={x:Static Globalization:CultureInfo.CurrentCulture}}"
                                                    Width="Auto" />
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>


XAMLParseException ocurred

Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception.

Inner Exception: {"Value cannot be null.\r\nParameter name: element"}


 
 at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri)<br>
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)<br>
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)<br>
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)<br>
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)<br>
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)<br>
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)<br>
   at System.Windows.FrameworkElement.ApplyTemplate()<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)<br>
   at Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(Size availableSize)<br>
   at Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(Size availableSize)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)<br>
   at Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)<br>
   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)<br>
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)<br>
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.Controls.Page.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)<br>
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)<br>
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)<br>
   at System.Windows.UIElement.Measure(Size availableSize)<br>
   at System.Windows.ContextLayoutManager.UpdateLayout()<br>
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)<br>
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()<br>
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()<br>
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)<br>
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)<br>
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)<br>
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)<br>
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()<br>
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)<br>
   at System.Threading.ExecutionContext.runTryCode(Object userData)<br>
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)<br>
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)<br>
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)<br>
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br>
   at System.Windows.Threading.DispatcherOperation.Invoke()<br>
   at System.Windows.Threading.Dispatcher.ProcessQueue()<br>
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)<br>
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)<br>
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)<br>
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)<br>
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)<br>
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)<br>
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)<br>
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)<br>
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)<br>
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)<br>
   at System.Windows.Application.RunDispatcher(Object ignore)<br>
   at System.Windows.Application.RunInternal(Window window)<br>
   at System.Windows.Application.Run(Window window)<br>
   at System.Windows.Application.Run()<br>
   at STV.Application.StartUp.Main(String[] args) 


G
Top achievements
Rank 1
 answered on 09 Jan 2013
1 answer
107 views
Hi
How can i change the layout of the RadDocking from code, i mean how to set the RadPane top,bottom,down or left.

Thanks,
Akram
Vladi
Telerik team
 answered on 09 Jan 2013
4 answers
164 views
Hi,
is there a way to display data to the gridview while im still loading the data?
Lets say im loading 10,000 records and i want to display 100 while the rest loads how do i do that?

Thanks
Markus
Top achievements
Rank 1
 answered on 09 Jan 2013
1 answer
155 views
Hello!
I'm writing an application with a radgridview bounded to a Linq EntityFramework query object and I have a problem in modifying cells content programmatically.

Once my grid is shown with bounded values I want to modify these values direclty in the gridview in editing mode, and this task works fine. Now I want to add a row to the grid with values taken from a function in the code behind. I have a series of value and I want to add them in a new row and show it in my gridview. Since I don't want to put them in database I can't save changes to my entity frameworks query object and then rebind to the gridview, but I simply want to add a row to the grid with my values, until the user want to definitely apply changes.

I tried making a dataset from my linq to entity query (same records as written in the gridview), and then Added new row to the dataset and binding it to the gridview. The last problem is to save changes in database, I should take values from the gridview back to a linq entity query and save changes. After creating a dataset from linq object I should now create a list (linq) from dataset...

To do this I set a new linq to entity query taking records from my dataset, but at this point my application rises error and I can not retrive data to save.

Does anybody faced a similar problem and can give me an example on how to procede? Any example? I search everywhere without finding a solution. In my application I don't use MVVM...

If necessary I can post my faulty code
Rossen Hristov
Telerik team
 answered on 09 Jan 2013
2 answers
341 views
I am using AggregateFunctions in GridView, but the function will not recalculate automatically when the data update.
I  tried to manually call CalculateAggregates(), but still not working.
I spent a lot of time to search for that, and found that a lot of people have similar problems. But I did't find a good solution.

The only way I know is to use Rebind() after the data updates. I think there should be some better ways.


I created a sample project here. If click the button, it will increase the number by one. If I group it by Position, and click the button, the number data value changes, but the  sum value does not.
Could someone help me with it please?

Thanks very much.



<Window x:Class="SampleProject.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:my="clr-namespace:SampleProject"
        Title="MainWindow" Height="700" Width="700">
 <Window.Resources>
  <my:MyViewModel x:Key="myViewModel"/>
 </Window.Resources>
    <Grid DataContext="{StaticResource myViewModel}">
  <Grid.RowDefinitions>
   <RowDefinition Height="*"/>
        
   <RowDefinition Height="Auto" />
  </Grid.RowDefinitions>
        <telerik:RadGridView Name="playersGrid" Grid.Row="0"
                                     ItemsSource="{Binding Players}"
                                     AutoGenerateColumns="False">  
   <telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Position}"/>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Number}">
     <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction SourceField="Number"  Caption="Column count: " />
     </telerik:GridViewDataColumn.AggregateFunctions>
    </telerik:GridViewDataColumn>
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}"/>
   </telerik:RadGridView.Columns>
  </telerik:RadGridView>
    
        <StackPanel Grid.Row="1" Orientation="Horizontal">
   <telerik:RadButton Name="Button1"
                Content="Update Data"
                Click="Button_Click"
                Margin="5"
                HorizontalAlignment="Left"/>
        
  </StackPanel>
 </Grid>
</Window>









kingnight
Top achievements
Rank 1
 answered on 09 Jan 2013
1 answer
144 views
Hi,
I have a grid view and I wonder is it possible to create a template for the first row in the grid?
Or can I specify item template for the first row only? What is the best workaround for this problem?

Thank you,
Ihor.
Yoan
Telerik team
 answered on 08 Jan 2013
3 answers
154 views
Hi,

I am using the Telerik DataFilter and was trying to compare values of two columns.

Basically I wanted to:

[Column1]    is less than [Column2]  - This filter should go through all the row and get only those rows where value of column1 is less than column2, provided here column1 and column2 are of same type(may be int)

I am getting list of columns by binding DataFilter to a collection. But I was wondering if it is possible to compare the rows in the column.

If it is possible, can you please point me to some example where this has already been implemented.

Thanks
Harpreet
Dimitrina
Telerik team
 answered on 08 Jan 2013
3 answers
207 views
Hi, i want to achieve some thing like "Pivot chart in Excel". i need to design custom x axis as shown in image. can you please give me any idea how to achieve it in RadChart.
Petar Marchev
Telerik team
 answered on 08 Jan 2013
3 answers
211 views
Hello,

I am using the WPF RadRichTextBox to enter text and images.

I am using the RtfFormatProvider to serialize/deserialize the contents of the RadDocument and save the document into the database. I do this by using the .Import and .Export methods. Additionally I am using GZipStream to compress/decompress.

I have tried just using the RtfFormatProvider without GZip to ensure it wasn't the compression/decompression causing a problem, but that did not make a difference.

The issue I am running into, is when I deserialize the RadDocument from the RtfFormatProvider and set the .Document of the RichTextBox, and then try to view the user control containing the RadRichTextBox, I get the following error, which locks up the UI:

------

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.Model.ImageDocumentElementHelper.SetupImage(Image image, IImageDocumentElement imageElement) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\ImageDocumentElementHelper.cs:line 107
   at Telerik.Windows.Documents.UI.UIProviders.ImageUIProvider.UpdateUI(UILayerUpdateContext uILayerUpdateContext) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\UIProviders\ImageUIProvider.cs:line 115
   at Telerik.Windows.Documents.UI.Layers.ProviderUILayerBase.UpdateUI() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\Layers\ProviderUILayerBase.cs:line 123
   at Telerik.Windows.Documents.UI.Layers.ProviderUILayerBase.UpdateViewPort(UILayerUpdateContext context) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\Layers\ProviderUILayerBase.cs:line 110
   at Telerik.Windows.Documents.UI.DocumentPagePresenter.UpdateUILayersViewPortSize(RectangleF viewPort) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPagePresenter.cs:line 838
   at Telerik.Windows.Documents.UI.DocumentPagePresenter.MeasureOverride(Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPagePresenter.cs:line 752
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\UI\DocumentPrintLayoutPresenter.cs:line 686
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Window.MeasureOverrideHelper(Size constraint)
   at System.Windows.Window.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Window.SetRootVisual()
   at System.Windows.Window.SetRootVisualAndUpdateSTC()
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.CreateSourceWindowDuringShow()
   at System.Windows.Window.SafeCreateWindowDuringShow()
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
 
 
------

The above error occurs when attempt to view the text box, it doesn't throw this error when I set the .Document.

I can successfully re-load content into the control if there is just text, but when I try to re-load a document that contains images it throws this error.

I have copied images into my document both straight from paint and from MS Office, and this did not make any difference either.

I would appreciate any suggestions or help anyone can offer.

Thank you.
Michael
Top achievements
Rank 1
 answered on 07 Jan 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?