This question is locked. New answers and comments are not allowed.
I am trying to use this example: http://www.telerik.com/help/silverlight/radtreeview-how-to-enabled-drop-inside-only.html, but the OnDropInsideTreeViewQuery never gets called. I am using the Q3_2009_1208 (SP1) release.
I have a breakpoint to confirm the RadDragAndDropManager.AddDropQueryHandler(tree, handler) gets called, but the breakpoint in handler is never hit.
I would expect this small example to work, based on the help document.
Tim
I have a breakpoint to confirm the RadDragAndDropManager.AddDropQueryHandler(tree, handler) gets called, but the breakpoint in handler is never hit.
I would expect this small example to work, based on the help document.
Tim
| <UserControl x:Class="SilverlightApplication10.MainPage" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
| mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> |
| <Grid x:Name="LayoutRoot"> |
| <Controls:RadTreeView |
| IsVirtualizing="True" |
| Grid.Row="0" Grid.Column="0" |
| x:Name="SelectionTree" |
| SelectionMode="Single" |
| IsDragDropEnabled="True"> |
| </Controls:RadTreeView> |
| </Grid> |
| </UserControl> |
| using System.Collections.ObjectModel; |
| using Telerik.Windows.Controls; |
| using Telerik.Windows.Controls.DragDrop; |
| using Telerik.Windows.Controls.TreeView; |
| namespace SilverlightApplication10 |
| { |
| public partial class MainPage |
| { |
| public MainPage() |
| { |
| InitializeComponent(); |
| SelectionTree.ItemsSource = new ObservableCollection<string>() {"One", "Two", "Three"}; |
| RadDragAndDropManager.AddDropQueryHandler(SelectionTree, OnDropInsideTreeViewQuery); |
| } |
| private void OnDropInsideTreeViewQuery(object sender, DragDropQueryEventArgs e) |
| { |
| RadTreeViewItem treeViewItem = e.Options.Destination as RadTreeViewItem; |
| TreeViewDragCue cue = e.Options.DragCue as TreeViewDragCue; |
| if (e.Options.Destination is RadTreeView || |
| (treeViewItem.Level == 0 && cue.IsDropPossible && |
| treeViewItem.DropPosition != DropPosition.Inside)) |
| { |
| e.QueryResult = false; |
| } |
| } |
| } |
| } |
