This question is locked. New answers and comments are not allowed.
Hello, I've been using 2011 Q2 09.20 hotfix version of radcontrols for silverlight. I'd like to upgrade but have been unable to do so because of issues with drag/drop with all versions released since.
I have a radtreeview that I want to allow dropping items from different sources onto specific tree items. As I mentioned this works fine in 2011 Q2 09.20 but not in later versions. The problem with the later versions appears to be that the DropQuery event is fired for the treeview, but not for the specific treeviewitems. Below is my code:
XAML:
Code behind:
Thanks
Doug
I have a radtreeview that I want to allow dropping items from different sources onto specific tree items. As I mentioned this works fine in 2011 Q2 09.20 but not in later versions. The problem with the later versions appears to be that the DropQuery event is fired for the treeview, but not for the specific treeviewitems. Below is my code:
XAML:
<
telerik:RadTreeView
x:Name
=
"rtvTags"
Grid.Row
=
"1"
ItemTemplateSelector
=
"{StaticResource TagTemplateSelector}"
ItemsSource
=
"{Binding Items}"
PreviewExpanded
=
"rtvTags_PreviewExpanded"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
AllowDrop
=
"True"
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource BindingsCollection}"
IsVirtualizing
=
"True"
>
Code behind:
public
partial
class
DocumentTagsView : ReviewView
{
public
DocumentTagsView()
{
InitializeComponent();
RadDragAndDropManager.AddDropInfoHandler(rtvTags, Tags_DropInfo);
RadDragAndDropManager.AddDropQueryHandler(rtvTags, Tags_DropQuery);
rtvTags.MouseLeave += (s, ea) =>
{
ViewModel.ResetIsDropTarget();
};
}
private
void
Tags_DropQuery(
object
sender, DragDropQueryEventArgs e)
{
e.QueryResult =
false
;
ViewModel.ResetIsDropTarget();
if
(e.Options.Payload
is
IList<IDSDocument> |
e.Options.Payload
is
IList<IDSSearch> |
e.Options.Payload
is
IList<SavedSearchItem>)
{
DocTagItem item = e.Options.Destination.DataContext
as
DocTagItem;
if
(item !=
null
)
{
e.QueryResult = item.CanBulkTag;
item.IsDropTarget =
true
;
e.Handled =
true
;
}
}
}
}
Thanks
Doug