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

Null pointer exception from RadPane when dragging inside RadTileViewItem

1 Answer 143 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 09 Mar 2015, 08:03 AM
Hi, in the following code I get an exception when i try to drag the content (not the header) of a RadTileViewItem

<Window x:Class="TelerikTest.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"
        Title="MainWindow" Height="350" Width="525">
  <Window.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Themes/VisualStudio2013/Themes/System.Windows.xaml" />
        <ResourceDictionary Source="Themes/VisualStudio2013/Themes/Telerik.Windows.Controls.Docking.xaml" />
        <ResourceDictionary Source="Themes/VisualStudio2013/Themes/Telerik.Windows.Controls.Navigation.xaml" />
        <ResourceDictionary Source="Themes/VisualStudio2013/Themes/Telerik.Windows.Controls.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

  </Window.Resources>
  <telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
      <telerik:RadPaneGroup x:Name="Group1">
        <telerik:RadPane x:Name="Pane1" Header="Server Explorer">
          <telerik:RadTileView>
            <telerik:RadTileViewItem Header="Test">
              <TextBlock Text="Start to drag here to crash"/>
            </telerik:RadTileViewItem>
          </telerik:RadTileView>
        </telerik:RadPane>
      </telerik:RadPaneGroup>
    </telerik:RadDocking.DocumentHost>
  </telerik:RadDocking>
  
</Window>

Am I doing something wrong here? I tried it in in Q1 2015 release and in a release from 2014

The last part of stacktrace is

An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.Docking.dll

  Telerik.Windows.Controls.Docking.dll!Telerik.Windows.Controls.RadPane.OnDragInitialize(object sender, Telerik.Windows.DragDrop.DragInitializeEventArgs e) Unknown
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializeEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Unknown
  PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
  PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
  PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDrag() Unknown
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDragPrivate(System.Windows.UIElement sender) Unknown
  Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.DragSourceOnMouseMove(object sender, System.Windows.Input.MouseEventArgs e) Unknown
  PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown


...

1 Answer, 1 is accepted

Sort by
0
Accepted
Geri
Telerik team
answered on 10 Mar 2015, 09:19 AM
Hello Philip,

Thank you for contacting us.

By design, every RadPaneGroup should have as a parent a RadSplitContainer, but in the current scenario such parent is not present. That is why a NullReferenceException is thrown. 

You can avoid this by placing the RadPaneGroup in a RadSplitContainer as follows:

<telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup x:Name="Group1">
                <telerik:RadPane x:Name="Pane1" Header="Server Explorer">
                    <telerik:RadTileView>
                        <telerik:RadTileViewItem Header="Test">
                            <TextBlock Text="Drag here"/>
                        </telerik:RadTileViewItem>
                    </telerik:RadTileView>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

Hope this helps.
 
Regards,
Geri
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Docking
Asked by
Philip
Top achievements
Rank 1
Answers by
Geri
Telerik team
Share this question
or