Issue with Drag&Drop in ListBox

1 posts, 0 answers
  1. Haidong
    Haidong avatar
    6 posts
    Member since:
    Sep 2011

    Posted 30 May 2012 Link to this post

    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?

    <Style TargetType="ListBoxItem"
               <Setter Property="telerik:DragDropManager.AllowDrag"
                       Value="True" />
               <Setter Property="telerik:DragDropManager.AllowCapturedDrag"
                       Value="True" />

    ListBox x:Name="MUL"
                                 ItemsSource="{Binding List1, Mode=TwoWay}"
                                 ItemContainerStyle="{StaticResource draggableItemStyle}"
                                 BorderBrush="{StaticResource BorderColor}">
                                    <controlsToolkit:WrapPanel Orientation="Horizontal"
                                                               Background="Transparent" />
                                <ControlTemplate TargetType="ListBox">
                                    <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                                        <Grid Background="Transparent">
                                                <ItemsPresenter />
                                <telerik:ListBoxDragDropBehavior />
                                <telerik:ScreenshotDragVisualProvider />
Back to Top