问题
I have been searching the internet high and low but can't find some examples that can help me.
I'm developing an application in wpf, in it I use a DataGrid; each cell has a DataTemplate with and image, in a mosaic style; on the side of the grid I have some tiles to use on the grid.
I'm able to drag the tiles but can't drop them on the grid because I can't find the cell to which make the drop. Is there a way to get a cell position from the the drag events?
Thanks
回答1:
Take a look at these:
- Drag and Drop
- Working with Data Objects
- Drag and Drop How-to Topics
- Drag and Drop Samples
- Moving WPF DataGrid Rows using Drag and Drop
- MVVM and the WPF DataGrid w/ demo app
- DataGrid Tips & Tricks: Row Drag & Drop
That should get you to where you need to be.
来源:https://stackoverflow.com/questions/2534040/wpf-drag-and-drop-to-datagrid