Drag Selecting Item not Drop file

1 posts, 0 answers
  1. John
    John avatar
    26 posts
    Member since:
    Mar 2012

    Posted 09 Dec 2012 Link to this post

    Hi,

    I'm try this code for drag selecting item if set AllowDrop true not drag and drop file in listbox.

    <Window.Resources>
        <Style TargetType="telerik:RadListBoxItem">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
        </Style>
    </Window.Resources>
    <Window.DataContext>
        <local:ExampleViewModel />
    </Window.DataContext>
     
    <Grid Background="White" x:Name="LayoutRoot">
        <telerik:RadListBox ItemsSource="{Binding CountryList}" AllowDrop="True" x:Name="listBox" Height="200"
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <telerik:RadListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Height="50" Width="100" Background="LightBlue" telerik:DragDropManager.AllowDrag="False">
                        <TextBox Text="{Binding CountryName}"
                                 VerticalAlignment="Center"
                                 PreviewMouseLeftButtonDown="TextBox_PreviewMouseLeftButtonDown"
                                 MouseLeave="TextBox_MouseLeave"
                                 HorizontalAlignment="Center"/>
                    </Grid>
                </DataTemplate>
            </telerik:RadListBox.ItemTemplate>
            <telerik:RadListBox.DragDropBehavior>
                <telerik:ListBoxDragDropBehavior AllowReorder="True"/>
            </telerik:RadListBox.DragDropBehavior>
            <telerik:RadListBox.DragVisualProvider>
                <telerik:ScreenshotDragVisualProvider />
            </telerik:RadListBox.DragVisualProvider>
            <telerik:RadListBox.DropVisualProvider>
                <telerik:LinearDropVisualProvider />
            </telerik:RadListBox.DropVisualProvider>
        </telerik:RadListBox>
Back to Top