This question is locked. New answers and comments are not allowed.
I use below code to create two list box and drag&drop listboxitem between this two list.
Sometimes it works well. But sometime when I drag item from list1 to list2, the item can not be drop to the list2. The item go back to the list1.
Please notice that I use Data template for the listboxitem and the data template is a little complex.
Could someone help me on that?
Sometimes it works well. But sometime when I drag item from list1 to list2, the item can not be drop to the list2. The item go back to the list1.
Please notice that I use Data template for the listboxitem and the data template is a little complex.
Could someone help me on that?
<Style TargetType="ListBoxItem" x:Key="draggableItemStyle"> <Setter Property="telerik:DragDropManager.AllowDrag" Value="True" /> <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" /> </Style>
<ListBox x:Name="MUL" ItemsSource="{Binding List1, Mode=TwoWay}" ItemContainerStyle="{StaticResource draggableItemStyle}" AllowDrop="True" Margin="10" BorderBrush="{StaticResource BorderColor}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <controlsToolkit:WrapPanel Orientation="Horizontal" Background="Transparent" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.Template> <ControlTemplate TargetType="ListBox"> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="auto" BorderThickness="0"> <Grid Background="Transparent"> <Border> <ItemsPresenter /> </Border> </Grid> </ScrollViewer> </ControlTemplate> </ListBox.Template> <ListBox.ItemTemplate> <DataTemplate> ....................... </DataTemplate> </ListBox.ItemTemplate> <telerik:ListBoxDragDrop.Behavior> <telerik:ListBoxDragDropBehavior /> </telerik:ListBoxDragDrop.Behavior> <telerik:ListBoxDragDrop.DragVisualProvider> <telerik:ScreenshotDragVisualProvider /> </telerik:ListBoxDragDrop.DragVisualProvider> </ListBox>