WPF拖放到DataGrid [英] WPF drag and drop to DataGrid

查看:432
本文介绍了WPF拖放到DataGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在互联网高低搜索,但找不到可以帮助我的一些例子。



我正在开发一个在wpf中的应用程序我使用一个 DataGrid ;每个单元格都有一个 DataTemplate 与图像,以马赛克风格;在网格的一边,我有一些瓷砖在网格上使用。



我可以拖动瓷砖,但不能将它们放在网格上,因为我找不到使细胞下降的细胞。有没有办法从拖动事件中获取单元格位置?



谢谢

解决方案

看看这些:


  1. 拖动
    删除

  2. 使用数据
    对象

  3. 拖放操作
    主题

  4. 拖放
    样本

  5. 使用拖动移动WPF DataGrid行和
    删除

  6. MVVM和WPF DataGrid w / demo
    应用程序

  7. DataGrid Tips&技巧:行拖
    删除

这应该让你到你需要的地方。 >

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

解决方案

Take a look at these:

  1. Drag and Drop
  2. Working with Data Objects
  3. Drag and Drop How-to Topics
  4. Drag and Drop Samples
  5. Moving WPF DataGrid Rows using Drag and Drop
  6. MVVM and the WPF DataGrid w/ demo app
  7. DataGrid Tips & Tricks: Row Drag & Drop

That should get you to where you need to be.

这篇关于WPF拖放到DataGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆