Click here to Skip to main content
12,892,596 members (45,441 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# WPF DataGrid

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
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[^]

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

Some good examples:

Drag and Drop in WPF[^]

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.170424.1 | Last Updated 14 Aug 2014
Copyright © CodeProject, 1999-2017
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