Hello,
We are using 2010.03 and started to explore Drag and Drop Framework for the scenario of allowing user to drag a list box item from FieldChooser control and drop on to itself to rearrange column positions.
While we achieve this by handling preview + drop events and custom adorner, wanted to find out if we can achieve the same using DragDropManager so we can avoid these events and adornors.
Below is my Xaml. When try to drag and drop an item from the FieldChooser the "DragSource_DragStart" is not getting triggered, instead the built-in drag behavior kicks in.
Any idea how to resolve this? Do I have to set the drag source on LabelPresenter inside FieldChooser or something for this to work Or the DragDropManager is not meant for this purpose?
Please clarify.
Thanks in advance.
<igDP:FieldChooser x:Name="fieldChooser" DataPresenter="{Binding ElementName=xamDataGrid1}" Width="180" Margin="2,2,2,10" FieldGroupSelectorVisibility="Collapsed" FieldDisplayOrder="SameAsDataPresenter" DockPanel.Dock="Left" IsManipulationEnabled="True"> <ig:DragDropManager.DragSource> <ig:DragSource IsDraggable="True" DragStart="DragSource_DragStart" Drop="fieldChooser_DropViaIfgFramework" /> </ig:DragDropManager.DragSource>
<ig:DragDropManager.DropTarget> <ig:DropTarget IsDropTarget="True" /> </ig:DragDropManager.DropTarget> </igDP:FieldChooser>
I suppose that the FieldChooser uses an items template for its items, so you can attach the DragSource to the root element of the data template(or style) instead to attach it to the FieldChooser.
Best regards.
Plamen.
Hi,
I try attaching the dragsource to ListBoxItem or the LabelPresenter. Both does not make any difference.
Here is my Xaml. I try replacing the TargetType to ListBoxItem. That does not help either. What I am missing? Any sample to look at it would be appreciated.
<igDP:FieldChooser x:Name="fieldChooser" DataPresenter="{Binding ElementName=xamDataGrid1}" FieldGroupSelectorVisibility="Collapsed" FieldDisplayOrder="SameAsDataPresenter" DockPanel.Dock="Left">
<igDP:FieldChooser.Resources> <Style TargetType="{x:Type igDP:LabelPresenter}"> <Setter Property="ig:DragDropManager.DragSource"> <Setter.Value> <ig:DragSource IsDraggable="True" DragStart="DragSource_DragStart" Drop="fieldChooser_DropViaIfgFramework" /> </Setter.Value> </Setter> </Style>
</igDP:FieldChooser.Resources>