iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I am having a slight issue with DataTemplates and the <Intersoft:DragDropBehavior/> behavior.
I have 2 collections in 2 different tabitems of a tab control.
The first collection is a list of text labels that the user should be able to drag onto the drawing surface. For this, I have used a UXListBox Bound to a collection of labels. My ItemTemplate for the UXListBox is as follows:
<DataTemplate x:Key="TextLibTemplate"> <Border> <StackPanel Orientation="Horizontal" > <TextBlock Text="{Binding Text}" FontSize="14" Tag="TextLib"> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior DragDropScope="Global" /> </i:Interaction.Behaviors> </TextBlock> </StackPanel> </Border> </DataTemplate>
The DragDrop functionality works perfectly for this.
However my 2nd list is a Hierarchical list of symbols that the user can drag onto the sketch surface, and for this I have used a UXTreeView control. I am using an <Intersoft:HierarchicalDataTemplate/> for the ItemTemplate on this UXTreeView. The HierarchicalDataTemplate is as follows:
<Intersoft:HierarchicalDataTemplate x:Key="SymbolLibTemplate" ItemsSource="{Binding Symbols}"> <Border> <StackPanel Orientation="Horizontal" > <TextBlock Text="{Binding Name}" FontSize="14" Foreground="Blue" /> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior IsDragable="False" /> </i:Interaction.Behaviors> </StackPanel> </Border> <Intersoft:HierarchicalDataTemplate.ItemTemplate> <Intersoft:HierarchicalDataTemplate> <Border> <StackPanel Orientation="Horizontal"> <Image Width="24" Height="24" Source="Assets/Images/icons/Symbols.png" /> <TextBlock Text="{Binding Name}" FontSize="14" Tag="SymbolLib" /> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior IsDragable="True" DragDropScope="Global" /> </i:Interaction.Behaviors> </StackPanel> </Border> </Intersoft:HierarchicalDataTemplate> </Intersoft:HierarchicalDataTemplate.ItemTemplate> </Intersoft:HierarchicalDataTemplate>
The Hierarchial list groups and list items show up in the UXTreeView control perfectly, however the DragDrop behavior has no effect here and does not work.
I have tried this in a very simplified manner as well using a HierarchicalDataTemplate like:
<Intersoft:HierarchicalDataTemplate x:Key="SymbolLibTemplate2"> <Border> <StackPanel Orientation="Horizontal" > <TextBlock Text="{Binding Name}" FontSize="14" Tag="SymbolLib"> <i:Interaction.Behaviors> <Intersoft:DragDropBehavior DragDropScope="Global" /> </i:Interaction.Behaviors> </TextBlock> </StackPanel> </Border> </Intersoft:HierarchicalDataTemplate>
to ensure that the additional complexity of the Hierarchical DataTemplate was not causing a problem.
The <Intersoft:DragDropBehavior/> just flat out, does not appear to work with the <Intersoft:HierarchicalDataTemplate/>. Which is preventing the DragDrop behavior from working at all with the UXTreeView.
Can you see anything that I am doing wrong here that may explain why I am not getting any kind of DragDrop behavior when i use the <Intersoft:HierarchicalDataTemplate/> as apposed to a regular <DataTemplat/>?
Just as an FYI, here is the main sketch surface of the application where both the text label adn symbol items are dropped. Again the text labels using a UXListBox and a normal <DataTemplate/> work perfectly, however the UXTreeView using a <Intersoft:HierarchicalDataTemplate/> does not work at all.
<Intersoft:UXFrame x:Name="SketchFrame" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Content="{Binding SketchPad}" MouseEnter="SketchFrame_MouseEnter" Cursor="None"> <i:Interaction.Behaviors> <Intersoft:DropTargetBehavior AllowDropItem="True" DropBehavior="Custom" Drop="SketchFrame_Drop" /> </i:Interaction.Behaviors> </Intersoft:UXFrame>
Thank you in advance for any insight you may be able to provide that will help me get this working with the UXTreeView.
Just a quick update... from the documentation it appears that UXTreeView only supports the copy and move type DragtDrop... I was able to get categorized lists working with DragDrop by using a UXAccordian instead of UXTreeView.
The functionality is almost identical to a treeview and imho it even looks nicer out of the box. So for now... it seems like my particular issue has been solved.
Hello,
I will discuss this issue with our developer teams. It would be more helpful if you can provide a simple runable project that replicates the issue.
Regards,Handy
Hmm,
I was almost done building a nice sample project to illustrate all of this without the clutter of my actual project, when I made an unexpected discovery... the issue is not withe the HierarchialDataTemplate after all. It is the UXTreeView.
Using <Intersoft:DragDropBehavior> on a TreeViewItem does not work... It seems I may need to find another way to implement Drag capability on the treeview item?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname