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

RadDocking Compass remain visible

8 Answers 265 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Gyula
Top achievements
Rank 1
Gyula asked on 25 Nov 2011, 04:42 PM
Dear Support!

I am using RadControls_for_WPF_2011_3_1116_Dev.
When I drag the Pane, the Compass remain visible, or sometimes I am getting a NullReferenceException (refer attachment).

Please let me know how to resolve the issue.


MainWindow.xaml
<Window x:Class="WpfApplication15.MainWindow"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" xmlns:WpfApplication15="clr-namespace:WpfApplication15" Title="MainWindow" Height="350" Width="525">
     
    <Window.Resources>
        <WpfApplication15:InternalDocking  x:Key="InternalDocking"/>
    </Window.Resources>
     
    <Grid>
         
        <Telerik:RadDocking x:Uid="Docking" Name="Docking" AllowUnsafeMode="True" Telerik:RadDocking.SerializationTag="Sz0">
            <Telerik:RadDocking.DocumentHost >
                <Telerik:RadSplitContainer x:Uid="Telerik:RadSplitContainer_1" Orientation="Horizontal" Telerik:RadDocking.SerializationTag="Sz1">
                    <Telerik:RadPaneGroup Name="MainGroup" Telerik:RadDocking.SerializationTag="Sz2">
                        <Telerik:RadPane Content="{StaticResource InternalDocking}" Header="Ellenőrző adatok"  Telerik:RadDocking.SerializationTag="Sz5"/>
                        <Telerik:RadPane Content="2" Header="Fejléc"  Telerik:RadDocking.SerializationTag="Sz3"/>
                        <Telerik:RadPane Content="3" Header="Alapadatok" Telerik:RadDocking.SerializationTag="Sz4"/>
                    </Telerik:RadPaneGroup>
                </Telerik:RadSplitContainer>
            </Telerik:RadDocking.DocumentHost>
        </Telerik:RadDocking>
 
    </Grid>
</Window>


MainWindow.xaml.cs
namespace WpfApplication15
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}


InternalDocking.xaml
<Telerik:RadDocking x:Class="WpfApplication15.InternalDocking"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300" AllowUnsafeMode="True" Telerik:RadDocking.SerializationTag="QA1">
 
    <Telerik:RadDocking.DocumentHost >
        <Telerik:RadSplitContainer x:Uid="Telerik:RadSplitContainer_1" Orientation="Horizontal" Telerik:RadDocking.SerializationTag="QA2">
            <Telerik:RadPaneGroup Name="MainGroup" Telerik:RadDocking.SerializationTag="Q31">
                <Telerik:RadPane Content="dragbug1" Header="Kiskacsa"  Telerik:RadDocking.SerializationTag="QA4" />
                <Telerik:RadPane Content="dragbug2" Header="Fürdik" Telerik:RadDocking.SerializationTag="Q51" />
                <Telerik:RadPane Content="dragbug3" Header="Fekete tóban" Telerik:RadDocking.SerializationTag="QA6" />
            </Telerik:RadPaneGroup>
        </Telerik:RadSplitContainer>
    </Telerik:RadDocking.DocumentHost>
 
</Telerik:RadDocking>


InternalDocking.xaml.cs
namespace WpfApplication15
{
    /// <summary>
    /// Interaction logic for InternalDocking.xaml
    /// </summary>
    public partial class InternalDocking
    {
        public InternalDocking()
        {
            InitializeComponent();
        }
    }
}



output when Compass remain visible:

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=(0); DataItem='ToolWindow' (Name=''); target element is 'WindowHostWindow' (Name=''); target property is 'Title' (type 'String')
'WpfApplication15.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WpfApplication15.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=(0); DataItem='DockElementsPopup' (Name=''); target element is 'WindowHostWindow' (Name=''); target property is 'Title' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=(0); DataItem='DockElementsPopup' (Name=''); target element is 'WindowHostWindow' (Name=''); target property is 'Title' (type 'String')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=(0); DataItem='ToolWindow' (Name=''); target element is 'WindowHostWindow' (Name=''); target property is 'Title' (type 'String')
A first chance exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.Docking.dll
The thread '<No Name>' (0x195c) has exited with code 0 (0x0).


or the throwed exception:

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       at Telerik.Windows.Controls.Docking.ToolWindow.OnDragEnd(Point globalMousePosition, Boolean isCancel, Boolean isResize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ToolWindow.cs:line 493
       at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragEnd(Point globalMousePosition, Boolean isCancel, Boolean isResize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 1237
       at Telerik.Windows.Controls.InternalWindow.DragBehavior.FinishDrag(Point globalMousePosition, Boolean isCancel) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\DragBehavior.cs:line 104
       at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementMouseLeftButtonUp(Object sender, MouseButtonEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\DragBehavior.cs:line 126
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(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.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at WpfApplication15.App.Main() in C:\Users\knyisztor\Documents\Megosztott\WpfApplication15\WpfApplication15\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

8 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 29 Nov 2011, 10:08 AM
Hello Balázs,

I am sorry, but putting Docking control into another Pane or Docking control is not supported. It is causing a lot of issues, such as this one, and that is why is not implemented yet.
However, we have logged this feature request in PITS. You can view it here. You can vote for it, track its status and see when it is going to be implemented.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Kumar
Top achievements
Rank 1
answered on 19 Dec 2011, 07:41 PM
We have similar issue and we are not putting a docking control another docking control or pane. Here is the error we see:

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=(0); DataItem='ToolWindow' (Name=''); target element is 'WindowHostWindow' (Name=''); target property is 'Title' (type 'String')

We also noticed with error from latest Q3 Telerik Version 
Please assist?
0
Konstantina
Telerik team
answered on 21 Dec 2011, 10:46 AM
Hi Kumar,

We are aware of this issue. It is already logged in PITS. You can vote for it and track its status there.

Best wishes,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
John Kears
Top achievements
Rank 1
answered on 22 Feb 2012, 08:25 PM
I hit the same issue, but I likely deserve it as you will see below, I am trying to avoid leaving a RadPane in a floating state and as such am purposely pushing the RadPane into a Docked/Document state through tracking of the Compas Unloaded event as initiated by the Preview Compass event which seems to continously fire.  I tried many other events and none really gave me what I was looking for except this one.  My approach works perfectly except for this occsional exception when I drag the view too far out of the limits of the window (or so it seems) ...

{System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Docking.ToolWindow.OnDragEnd(Point globalMousePosition, Boolean isCancel, Boolean isResize)
   at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragEnd(Point globalMousePosition, Boolean isCancel, Boolean isResize)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.FinishDrag(Point globalMousePosition, Boolean isCancel)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}
 
This happens very infrequently so I'd really like to understand what is the root cause as its a critical issue for me.

Here is my code where you can ignore a few of my proprietary interfaces which are used to store previous SplitContainer information.

Note: The exception never hits either of my Catch statements ...

private RadSplitContainer _previewContainer;
         
       void PreviewShowCompass(object sender, PreviewShowCompassEventArgs e)
       {
           try
           {
               e.Compass.Unloaded -= CompassUnloaded;
               e.Compass.Unloaded += CompassUnloaded;
                 
               if (e.DraggedSplitContainer == null) return;
                 
               _previewContainer = e.DraggedSplitContainer;
                 
           }
           catch (Exception ex)
           {
                 
               Debug.WriteLine(ex);
           }
            
       }
        
       void CompassUnloaded(object sender, System.Windows.RoutedEventArgs e)
       {
           try
           {
               var compass = sender as Compass;
               if(compass != null)
               {
                   compass.Unloaded -= CompassUnloaded;
               }
               var lastContainer = _previewContainer;
               _previewContainer = null;
               IDockShellDockControl dockControl = null;
               if (lastContainer == null) return;
               if(lastContainer.IsInToolWindow)
               {
                   object lastHostableContainer = null;
                   foreach(var item in lastContainer.Items)
                   {
                       var radPaneGroup = item as RadPaneGroup;
                       if(radPaneGroup != null)
                       {
                           foreach (var screenItem in radPaneGroup.Items)
                           {
                               var radPane = screenItem as RadPane;
                               if(radPane != null)
                               {
                                   var viewControl = radPane as IViewControl;
                                   if(viewControl != null)
                                   {
                                       lastHostableContainer = viewControl.ViewModel.LastHostableContainer;
                                       dockControl = viewControl.ViewModel.DockControl;
                                       break;
                                   }
                               }
                           
                       }
                   }
                  
                   var lastSplitContainer = lastHostableContainer as RadSplitContainer;
                   var splitContainerControl = lastSplitContainer as ISplitContainerControl;
                   if (splitContainerControl != null)
                   {
                       while (lastContainer.Items.Count > 0)
                       {
                           var radPaneGroup = lastContainer.Items[0] as RadPaneGroup;
                           if (radPaneGroup != null)
                           {
                               radPaneGroup.RemoveFromParent();
                               lastSplitContainer.Items.Add(radPaneGroup);
                           }
                       }
                   }
                   else
                   {
                       var newSplitContainer = new RadSplitContainer {InitialPosition = lastContainer.InitialPosition};
                       if (dockControl != null) dockControl.ViewModel.Items.Add(newSplitContainer);
                       while (lastContainer.Items.Count > 0)
                       {
                           var radPaneGroup = lastContainer.Items[0] as RadPaneGroup;
                           if (radPaneGroup != null)
                           {
                               radPaneGroup.RemoveFromParent();
                               newSplitContainer.Items.Add(radPaneGroup);
                           }
                       }
                   }
               }
               else
               {
                   foreach (var item in lastContainer.Items)
                   {
                       var radPaneGroup = item as RadPaneGroup;
                       if (radPaneGroup != null)
                       {
                           foreach (var screenItem in radPaneGroup.Items)
                           {
                               var radPane = screenItem as RadPane;
                               if (radPane != null)
                               {
                                   var viewControl = radPane as IViewControl;
                                   if (viewControl != null)
                                   {
                                       viewControl.ViewModel.LastHostableContainer = lastContainer;
                                   }
                               }
                           }
                       }
                   }
               }
           }
           catch (Exception ex)
           {
               Debug.WriteLine(ex);
           }
       }

0
Konstantina
Telerik team
answered on 23 Feb 2012, 03:37 PM
Hello John,

You have to handle the PreviewClose event, since you are removing a pane from the parent. Please add the following in the PreviewClose:

e.Handled = true;


All the best,
Konstantina
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
John Kears
Top achievements
Rank 1
answered on 23 Feb 2012, 03:58 PM
Ideally I would not even want take this approach at all however I have one issue that I can't seem to resolve with the float window which if I could solve, I'd be a very happy man!

I am currently wrapping a 3rd party control  and all works really well however when I float a window that contains the 3rd party control all still works well until a Modal screen is opened from the 3rd party control. 

When I do open a modal screen, the parent 3rd party control screen shows as disabled as it should, however I do not see the Modal window, its as if its behind the floating window... ZIndex issue??

In all other Docking / Document views when I repeat this scenario, I do see this Modal screen so it is only when in a Floating window that the model view does not show. 

Also ... in the same Floating scenario when the modal view is up but just can't be seen, if I drag the window from Floating to be a dockable / document view whilst still in this mode, once docked/document, I then see the modal screen that was hidden while in Float.

Is there any thing I can try (templating if so, where do I apply it)  to change the float behaviour? 
0
John Kears
Top achievements
Rank 1
answered on 23 Feb 2012, 06:56 PM
I added a handler to listen for PreviewClose on the Docking but it never fires?

Can you explain in more detail as to where I should be placing this PreviewClose event.
0
George
Telerik team
answered on 28 Feb 2012, 04:05 PM
Hello John,

Please, let me check whether I understand what is the problem with the RadDocking control - when opening a modal window from the usercontrol, placed in a floating pane, the opened modal window stays behind the floating pane, doesn't it? If this is the issue, what I would suggest is using the RadWindow control. With the RadWindow.ShowDialog method the opened window will be on top of all other opened windows. I made a sample project that show this behavior.

If the RadWindow control doesn't filled your requirements, pleace double check which is the owner of the modal window - the ToolWindow must be its owner, otherwise the modal window might go behind the ToolWindow.

 

Regards,
George
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Docking
Asked by
Gyula
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Kumar
Top achievements
Rank 1
John Kears
Top achievements
Rank 1
George
Telerik team
Share this question
or