WPF Sidebar style drag and drop - wpf

I'm trying to write a WPF control that has similar functionality to the Windows Sidebar.
The functionaly I would like to replicate is the drag and drop ordering. When dragging an item the other items move out of the way to show you where the item will end up when dropped.
Has anyone else had to implement this sort of functionality, if so how did you go about it?

I've been meaning to write something like that myself, but haven't quite gotten there yet. Take a look at Bea Stollnitz's drag and drop post. The insert adorner isn't the main focus of her post, but she discusses it.

Related

Row dragging in DataGrid

I have a DataGrid in a WPF application, right now when I click on a cell it highlights the whole row and when I then drag down the rows it highlights all of the rows in between.
What I need is for dragging over a row to copy the value from the cell you start on over all the rows you drag it over and only highlight the rows in the specific column.
The exact words in the request were "like Excel".
Is there a written control for this? I have searched SO and have not found exactly what I am looking for. If the control does not exist, what is a good starting place?
A good starting place for you to learn how to code Drag and Drop.
I recently created a treeview with Drag and Drop functionality.
You might get some ideas on how drag and drop works from this project.
You can download it here: https://drive.google.com/file/d/0B5WyqSALui0bYmJ4SkEzXzdmUk0/view?usp=sharing
If you need any help then feel free to ask....
Best of Luck.....

WPF drag drop listbox

I'm looking for a WPF drag drop library/article/tutorial that can:
Drag/drop to reorder list box items
Animate the panel as item is dragged (as shown in screen shot)
I've had a quick look at Telerik's DragDropManager, which comes with ListBoxDragDropBehavior. It provides drag/drop reordering, but not quite the behaviour as in my screenshot.
I would love to learn to write one from scratch eventually (adorners, animated panels, etc), but I'm currently time-constrained to using out-of-the-box libraries.
[edit]
The behaviour I'm looking for is the same as Windows 8's start screen
Check out Moving WPF DataGrid Rows using Drag and Drop which shows how to reorder DataGrid rows via drag drop and how to customize the drag indicator.

Drag Drop with multiselect

I've implemented drag-and-drop from a listbox to a treeview with the help of this question. The only thing I haven't figured out yet is how to drag more than one item from the listbox. I've enabled multiselect on the listbox, but when I have multiple items selected and start the drag, it deselects everything except for the item directly under the mouse pointer. Has anyone gotten drag-and-drop to work with multiselect, and if so, how?
You have to keep the ctrl or shift key pressed when you begin the drop, if you let go the listbox goes back to 'begin select' mode again.
I see this as a bug in the framework as the multi-select behaviour is different to the one in Windows Explorer and is not intuitive at all. See my suggestion here.

Silverlight: Drag multiple rows from a datagrid

I am working on an app where the user needs to be able to drag items from a datagrid onto a button (this then fires some data updates). After some messing around, I have this working quite well. I have used the DataGridDragDropTarget controls from the toolkit for this.
I now need to allow the user drag multiple rows at once. While the datagrid allows me to select multiple rows, the DataGridDragDropTarget will only drag the first of the selections.
It looks like the DataGridDragDropTarget is not built for multiple dragging.
Would be grateful for any help on this one, this is the first time I have posted on SO - and hoping you guys can come through for me.
Thanks all.
It will drag multiple rows for sure. I am sure you are doing same mistake as i did. I believe all your code are fine.
To drag multiple row click on one row press shift or ctrl to select multiple but "Note here: If you release your mouse click here before drag it will forget what are the multiple items it has selected", so just drag without leaving mouse on your last selected item.(So, I think it works that way without doing anything)
However I am also searching for someway to make it work like drag and drop as in desktop. ;-)

WPF Drag-and-Drop between ListBoxes in different UserControls

This is the structure of my application:
Main Window has two ContentControls
Each ContentControl has a UserControl
Each UserControl has a ListBox
So graphically speaking, the user is presented with a Window with two ListBoxes: one with products and the other a shopping cart.
I want to enable drag-and-drop functionality among these two ListBoxes; i.e products can be dragged into the shopping cart.
I have seen examples of drag-and-drop between ListBoxes on the same window. But is it possible to drag and drop between UserControls?
I have looked at an example; is there a simpler way?
I came across a simple drag drop solution in Expression Blend; I tried searching for it, but in vain.
Drag-and-drop using behaviors is very simple. Download this complete implementation and sample and try it out:
ItemsControl Drag Drop Behavior for WPF
It is not clear what is a problem if you've already seen how to do drag-n-drop between listboxes on the same window. Use this code or tell us what's wrong with it.
The good thing about drag-n-drop functionality is that control which starts DND operation doesn't have to know anything regarding control which accepts DND result.

Resources