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

Internal Null Reference in RadDocking

2 Answers 154 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 10 Jul 2012, 09:53 PM
Hello,

I have dock that starts out docked right.  When I undock it, and try to add it to the document host (center) on the right side, I get a null reference exception before I even realease the mouse.  The exception detail is listed below, as well as a shortened version of the docking I am using.  Any idea why this might happen?

EDIT: Using Q2, WPF, .Net 4.0

Thanks,
Eric

<telerik:RadDocking Grid.Row="1" x:Name="radDock"
                            telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True"
                            BorderThickness="0"  Padding="0" Visibility="Hidden">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadPaneGroup x:Name="MainGroup">
                    <telerik:RadPane x:Name="GanttPane" Header="Build Directories" ContextMenuTemplate="{x:Null}">
                        <Grid>
                       </Grid>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="300,800" x:Name="RightContainer" InitialPosition="DockedRight">
                <telerik:RadPaneGroup x:Name="RightGroup">
                    <telerik:RadPane x:Name="DirInfoPane" Header="Directory Information" IsHidden="True">
                        <ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                        </ListBox>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
</telerik:RadDocking>


System.NullReferenceException was unhandled
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       at Telerik.Windows.Controls.RadDocking.GetElementPositionAtScreenRoot(FrameworkElement element) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 1473
       at Telerik.Windows.Controls.RadDocking.GetCuePosition(RadPaneGroup targetGroup, DockPosition position, Size draggedElementRelativeSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 1370
       at Telerik.Windows.Controls.RadDocking.AdjustCueSizeAndLocation(Size draggedElementRelativeSize, Size draggedElementInitialSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 1385
       at Telerik.Windows.Controls.RadDocking.OnDragContainer(RadSplitContainer container, Point globalMousePosition) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 389
       at Telerik.Windows.Controls.RadDocking.OnToolWindowDrag(ToolWindow window, Point globalMousePosition) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 276
       at Telerik.Windows.Controls.Docking.ToolWindow.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ToolWindow.cs:line 522
       at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 1267
       at Telerik.Windows.Controls.InternalWindow.WindowHostBase.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowHostBase.cs:line 85
       at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.OnWindowPositionUpdating(Rect windowPosition) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowChrome\ChromelessWindowHelper.cs:line 350
       at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.HandleMoving(IntPtr hwnd, IntPtr wParam, IntPtr lParam, Boolean& handled) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowChrome\ChromelessWindowHelper.cs:line 551
       at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\WindowChrome\ChromelessWindowHelper.cs:line 857
       at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  InnerException:

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 12 Jul 2012, 12:11 PM
Hi Eric,

It seems that you need SplitContainer in the DocumentHost. It would be great if you can give it a try and let us know if this works for you:
<telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                <telerik:RadPaneGroup x:Name="MainGroup">
                    <telerik:RadPane x:Name="GanttPane" Header="Build Directories" ContextMenuTemplate="{x:Null}">
                        <Grid>
                       </Grid>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>



Regards,
Georgi
the Telerik team

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

0
Eric
Top achievements
Rank 1
answered on 12 Jul 2012, 04:35 PM
Yes, that solved it.  Thanks!

Eric
Tags
Docking
Asked by
Eric
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Eric
Top achievements
Rank 1
Share this question
or