Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Drag and Drop multiple items FROM Listbox
posted

I am interested in being able to drag multiple items from a SL Listbox to a xamDataTree using the DragDropManager.  Is that possible? Even though I have my listbox set to SelectionMode="Extended", when I start dragging the DragDropStartEventArgs Data property is set to only one of the selected items. I have seen other posts about dragging multiple XamGridRows, but none of them seem to apply to a ListBox. Any help would be appreciated.

<ListBox x:Name="lbFilteredContacts"
             ItemsSource="{Binding FilteredContacts}"
             SelectionMode="Extended"
             MaxHeight="300"
             MinWidth="300"
             Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Margin="5"
             Visibility="{Binding ContactListVisible}">
         <ListBox.ItemTemplate>
              <DataTemplate>
                   <StackPanel Orientation="Horizontal">
                       <Image Source="{Binding image}" Height="16" Width="16" Margin="5"/>
                        <TextBlock Text="{Binding fullName}" Margin="5"/>
                        <ig:DragDropManager.DragSource>
                            <ig:DragSource x:Name="dsListBox" 
                                 IsDraggable="True"
                                 Drop="dsListBox_Drop"
                                 DataObject="{Binding}"
                                 DragStart="dsListBox_DragStart"/>
                            </ig:DragDropManager.DragSource>
                      </StackPanel>
                   </DataTemplate>
                </ListBox.ItemTemplate>
             </ListBox>
Parents Reply Children
No Data