With a default RadListBox, that displays all of its children vertically, then if you drag an item at the top or the bottom of the screen, the RadListBox will automatically scroll up or down.
f you set the RadListBox to display horizontally, and drag to the right, then the RadListBox will auto scroll only if the right edge of the item is visible and can be dragged past. If the element is too wide, then the scrolling to the right will stop. If you drag to the left, then the auto scrolling will scroll all the way to the beginning of the items.
<Grid>
<Grid.Resources>
<Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem">
<Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
</Style>
</Grid.Resources>
<telerik:RadListBox ItemsSource="{Binding Documents}">
<telerik:RadListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</telerik:RadListBox.ItemsPanel>
<telerik:RadListBox.ItemTemplate>
<DataTemplate>
<telerik:RadListBox ItemsSource="{Binding Pages}" ItemContainerStyle="{StaticResource DraggableListBoxItem}">
<telerik:RadListBox.DragDropBehavior>
<telerik:ListBoxDragDropBehavior />
</telerik:RadListBox.DragDropBehavior>
<telerik:RadListBox.DragVisualProvider>
<telerik:ScreenshotDragVisualProvider />
</telerik:RadListBox.DragVisualProvider>
<telerik:RadListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding ImageData}"/>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>
</Grid>
Is there a way to get the scrolling to the right to work smoothly?
In the posted example, we want to allow the dragging of a Page from one Document into another Document, and the reordering of Pages within a document.
f you set the RadListBox to display horizontally, and drag to the right, then the RadListBox will auto scroll only if the right edge of the item is visible and can be dragged past. If the element is too wide, then the scrolling to the right will stop. If you drag to the left, then the auto scrolling will scroll all the way to the beginning of the items.
<Grid>
<Grid.Resources>
<Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem">
<Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
</Style>
</Grid.Resources>
<telerik:RadListBox ItemsSource="{Binding Documents}">
<telerik:RadListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</telerik:RadListBox.ItemsPanel>
<telerik:RadListBox.ItemTemplate>
<DataTemplate>
<telerik:RadListBox ItemsSource="{Binding Pages}" ItemContainerStyle="{StaticResource DraggableListBoxItem}">
<telerik:RadListBox.DragDropBehavior>
<telerik:ListBoxDragDropBehavior />
</telerik:RadListBox.DragDropBehavior>
<telerik:RadListBox.DragVisualProvider>
<telerik:ScreenshotDragVisualProvider />
</telerik:RadListBox.DragVisualProvider>
<telerik:RadListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding ImageData}"/>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>
</Grid>
Is there a way to get the scrolling to the right to work smoothly?
In the posted example, we want to allow the dragging of a Page from one Document into another Document, and the reordering of Pages within a document.