views:

18

answers:

0

Hi, when i use controlToolkit:LisBoxDragDropTarget with ListBox i am able to do drag and drop... but if i provide ItemsTemplate to ListBox then "drop" is not working...

Xaml which is working

    <controlsToolkit:ListBoxDragDropTarget  x:Name="lstddPSGroups1" Grid.Column="0" Grid.Row="1" AllowDrop="true" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                <ListBox  x:Name="lstPSGroups1" ItemsSource="{Binding Path=obj}" SelectionMode="Extended"  DisplayMemberPath="ModuleName" AllowDrop="True" Drop="lstPSGroups_Drop">
                   <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>
    </controlsToolkit:ListBoxDragDropTarget>

Xaml which is not working

 <UserControl.Resources>
        <DataTemplate x:Key="Test">
            <StackPanel MinWidth="400" Orientation="Vertical">
                <TextBlock Text="{Binding Path=ModuleName, Mode=TwoWay}" MinWidth="100"></TextBlock>
                <TextBlock Text=" : "></TextBlock>
                <TextBlock Text="{Binding Path=OrderNo, Mode=TwoWay}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

 <controlsToolkit:ListBoxDragDropTarget  x:Name="lstddPSGroups" Grid.Column="0" Grid.Row="0" AllowDrop="true" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
            <ListBox  x:Name="lstPSGroups" ItemsSource="{Binding Path=obj}" SelectionMode="Extended"  ItemTemplate="{StaticResource  Test}" AllowDrop="True" Drop="lstPSGroups_Drop">
                <!--<ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>-->
            </ListBox>
        </controlsToolkit:ListBoxDragDropTarget>

please if anybowy knows provide me soln. that how can i do "Drag and Drop" functionality in listbox with ItemsTemplate...