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

NullReference in Telerik.Windows.Controls.Diagrams

1 Answer 35 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 06 Jun 2012, 03:05 AM
Hello,

I am evaluating the Telerik diagramming component for WPF and am getting a run time error from the basic example in the documentation, http://www.telerik.com/help/wpf/raddiagram-data-code-behind.html.  In my project I have referenced the following libraries from the RadControls for WPF Q1 2012 SP1\Binaries\WPF40 directory:
Windows.Controls
Windows.Controls.Diagrams
Windows.Diagrams.Core

Am I missing needed references?

Thank you for your help.

Stack trace:
    at Telerik.Windows.Controls.RadDiagramConnection.Update(Boolean isManipulating) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Diagrams\Diagrams\Visuals\Connections\RadDiagramConnection.cs:line 563
   at Telerik.Windows.Controls.RadDiagramConnection.OnApplyTemplate() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Diagrams\Diagrams\Visuals\Connections\RadDiagramConnection.cs:line 490
   at System.Windows.FrameworkElement.ApplyTemplate()
   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 System.Windows.Controls.Canvas.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)
   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 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.Decorator.MeasureOverride(Size constraint)
   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.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Forms.Integration.ElementHost.OnHandleCreated(EventArgs e)
   at System.Windows.Forms.Control.WmCreate(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Integration.ElementHost.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Jun 2012, 07:54 AM
Hello Christopher,

 We managed to reproduce this issue. The good news is that it is already resolved and the fix is included in our Q2 release scheduled for the middle of this month. If this is critical for you currently, you can use Dispatcher like so:

diagram.Items.Add(shapeCloud);
        diagram.Items.Add(dbShape);
        Dispatcher.BeginInvoke(new Action(()=>
        diagram.Items.Add(connection)));
        diagram.SelectAll();
But we highly suggest you to wait for the upcoming release. You can expect lots of improvements and new features in the RadDiagramming Framework.

Kind regards,
Petar Mladenov
the Telerik team

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

Tags
Diagram
Asked by
Christopher
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or