Click here to Skip to main content
12,349,884 members (22,756 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# WPF DataGrid
Hello,


I am making a WPF application , in which i have a datagrid which contains list of employees.

On the left of window i have a treeview which shows all departments & subdepartments.

What i want is that i select a employee / row in datagrid and drag it over to the specific node of treeview and finally i get the data of row/rows i selected so that i could move them to selected department. But i am unable to get logic on how to do drag n drop in WPF datagrid. Please help
Posted 13-Aug-14 20:59pm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Drag & Drop in WPF an MVVM can be hard to do.
I use this library GongSolutions.Wpf.DragDrop library[^] it is nice and easy to work with.
Give it a try, you can find it on NuGet https://www.nuget.org/packages/gong-wpf-dragdrop/[^]

It will work on any WPF control that has bind an ItemSource to a collection.

Some good examples:

Drag and Drop in WPF[^]
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 14 Aug 2014
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100