Click here to Skip to main content
15,946,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have one grid control with four columns and four rows. Each cells are having one image and below one text as like as IPhone icons. This grid fill up the controls dynamically at run time. Now i need to perform drag and drop operation on it. But i dont know how do i perform it. I arised on google with lot of answers and there were having only Itemscontrol,Datagrid,Listbox drag and drop only. No answers in grid. Can anyone say the appropriate answer for me. Please i need this.

You will need to implement custom dragdrop in your views. Here[^] is some information on this.

Merge Two Rows by Drag and Drop in a WPF Toolkit DataGrid Using MVVM[^] is a sample for using these constructs.
Share this answer
janablisslogix 17-Nov-11 1:30am    
Thank you my dear friend. It is having only Datagrid but i am asking within Grid control only
If you read up on WPF drag and drop you can come up with a way to do it.

Drag and Drop Overview[^]

A few possible ways off the top of my head...

1) Use the grid as both a drag source and drop target. The grid handles all movement of its child elements
2) Make the child elements drag sources and drop targets. They'd need to be able to notify the grid of movement
3) Make the child elements drag sources and make the grid a drop target.

The third one is probably easiest to implement. The grid's row and column definitions can be used to find the cell dropped into.
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900