Hi all!
I have had a very annoying problem with Silverlight treeview drag and drop.
I built my organization structure with TreeView item and entity framework.
So, I have something like the next one in my TreeView:
This is my XAML for TreeView :
<toolkit:TreeViewDragDropTarget Margin="11,11,1218,0" Grid.Column="2"><sdk:TreeView x:Name="organizationStructureTreeView" Grid.Column="1" SelectedItemChanged="organizationStructureTreeView_SelectedItemChanged_1" Grid.ColumnSpan="2" Height="452" Width="247" RenderTransformOrigin="0.498,0.503" ><sdk:TreeView.ItemTemplate><sdk:HierarchicalDataTemplate ItemsSource="{Binding OrganizationStructure1}" ><TextBlock Text="{Binding OrgUnitNameEng}"/></sdk:HierarchicalDataTemplate></sdk:TreeView.ItemTemplate></sdk:TreeView></toolkit:TreeViewDragDropTarget>
and this one is for ListBox control:
<toolkit:ListBoxDragDropTarget AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Column="2" Margin="294,19,950,20" Grid.Row="1"><ListBox x:Name="Result" RenderTransformOrigin="0.5,0.5" Margin="6,4,10,2" Grid.Column="3" AllowDrop="True" SelectionChanged="ListBox_SelectionChanged_2" Drop="ListBox_Drop"><ListBox.ItemTemplate ><DataTemplate><StackPanel Orientation="Horizontal"><TextBlock Text="{Binding OrgUnitNameEng}" Margin="5,0,0,0"/></StackPanel></DataTemplate></ListBox.ItemTemplate></toolkit:ListBoxDragDropTarget>I try to form another list with TreeView Items and Listbox element, using Drag and Drop. It is working right when I drag root element from the TreeView and it land up into the ListBox.
But when I try to move non root element from the TreeView, I obtain blank web page and all my controls disappeared without any errors.
Thank you in advance for all who will try to help me!