Generic DragDrop Behavior in WPF DataGrid

我怕爱的太早我们不能终老 提交于 2019-12-11 18:09:53

问题


I made a Behavior Drag Drop Beahvior which take a Collection (Implementing IList like ObservableCollection,LIst)

And its working alrght...

but if I Use CollectionViewSource.View (in the Xaml Binding), the behavior falis....

How could I make this behavior Generic (LIke independent of type of DataSource attached to DataGrid)

Is it even possible as I am using methods for IList interface like

Insert(object item)

回答1:


This problem already has an open source solution, see Wpf Drag & Drop behaviour. This behavior will implement drag drop for any ItemsControl, it should work for datagrid too.



来源:https://stackoverflow.com/questions/10495448/generic-dragdrop-behavior-in-wpf-datagrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!