Generic DragDrop Behavior in WPF DataGrid
-
06-06-2021 - |
Question
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)
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow