我已经使用Telerik控件在WPF中实现了rad网格视图的拖放功能,我能够从本地系统中拖动文件,但无法从电话和Pendrive等外部设备中拖动文件
下面是使用的代码
private void OnElementDragOver(object sender,
Telerik.Windows.DragDrop.DragEventArgs e)
{
var files = (IEnumerable<string>)(e.Data as
DataObject).GetData(System.Windows.DataFormats.FileDrop);
if (files != null)
{
if (Resources.Enums.IsImageDrog(files))
{
string[] contact = (e.Data as
DataObject).GetData(System.Windows.DataFormats.FileDrop) as
string[];
if (this.DataContext is TestResultLibraryVM && contact !=
null)
(this.DataContext as
TestResultLibraryVM).AddDroped(contact.OfType<string>
().ToList());
}
}
}