This is a migrated thread and some comments may be shown as answers.

DragDrop Scrolls Through ListBox Too Quickly

3 Answers 74 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Corey
Top achievements
Rank 2
Corey asked on 18 Mar 2015, 03:06 PM
I have a System.Windows.Controls ListBox with a decent number of items within it (say around 50).  I have implemented drag and drop controls with the ListBox through the use of RadDragAndDropManager.  However, the problem we are having is that when a user selects a ListBoxItem and tries to reorder it by dragging it to its desired position, the ListBox scrolls much too quickly to easily and accurately place the dragged item in its desired spot.

It seems like the sensitivity for scrolling the ListBox while dragging an item is too high.  Is there any way to slow down this scrolling behavior for easier drag and drop placement?  Currently, we have instituted buttons to allow for simply moving an item up and down in the ListBox, one row at a time, but that can be tiresome with larger lists of items.

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 23 Mar 2015, 09:58 AM
Hi Corey,

The observer behavior is not caused by the DragDropManager, but by the ListBox control. What we could suggest you is instead ListBox to use RadListBox. You could modify the default RadListBoxStyle and by setting greater ScrollingSettingBehavior.ScrollStepTime and/or smaller ScrollingSettingBehavior.ScrollStep the scrolling will be slower and/or starting after less pixels:
<Style TargetType="telerik:RadListBox" BasedOn="{StaticResource {x:Type telerik:RadListBox}}">
    <Setter Property="telerik:ScrollingSettingsBehavior.ScrollStep" Value="20" />
    <Setter Property="telerik:ScrollingSettingsBehavior.ScrollStepTime" Value="00:00:00.10" />
</Style>

Hopes this helps.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Corey
Top achievements
Rank 2
answered on 23 Mar 2015, 06:28 PM
Thanks for the reply and pointing me in the right direction.  I switched our control over to a RadListBox like you suggested, but since we do all of our work programmatically, I implemented your solution with the following code:

RadListBox listBox = new RadListBox();
listBox.SetValue(ScrollSettingsBehavior.ScrollStepProperty, 20.0);
listBox.SetValue(ScrollSettingsBehavior.ScrollStepTimeProperty, new TimeSpan(0, 0, 0, 10));

However, changing those values (making ScrollStep smaller or ScrollStepTime longer) did not seem to have any noticeable effect.  While dragging a RadListBoxItem inside of it, it immediately jumps to the bottom of the ScrollView unless you are incredibly slow with your mouse movements.

Any additional help would be greatly appreciated.  Did I implement your solution in the code-behind correctly?
0
Nasko
Telerik team
answered on 24 Mar 2015, 07:10 AM
Hi Corey,

Yes, this is the correct way to set the ScrollStep and ScrollStepTime properties in code-behind. Could you please provide us some more additional information about your scenario? Sending us a code snippet of the declaration and settings of the other properties of RadListBox and how the drag-drop functionality is enabled will be of great help in our further investigation. Thus we could provide you with a prompt solution if possible. Also, please check this article from our help documentation that provides a detailed information about the drag-drop functionality of RadListBox. Please, check if you hadn't missed something,

We're looking forward to hearing from you.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
DragAndDrop
Asked by
Corey
Top achievements
Rank 2
Answers by
Nasko
Telerik team
Corey
Top achievements
Rank 2
Share this question
or