Null pointer exception from RadPane when dragging inside RadTileViewItem

2 posts, 1 answers
  1. Philip
    Philip avatar
    13 posts
    Member since:
    Mar 2015

    Posted 09 Mar 2015 Link to this post

    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


    ...
  2. Answer
    Geri
    Admin
    Geri avatar
    60 posts

    Posted 10 Mar 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top