I'm hoping somewhere here on the forums can help me as I've searched all over (on the forums) and in the documentation and examples and are coming up dry. Right now I'm building a system in where the end-user can take a product (or products) from a RadGridView and drag them over to a RadTreeView which contains Categories and onto a RadTreeViewItem.
The entire system as it stands works perfectly for a single GridViewItem but I need to be able to support multiple items. Unfortunately I have not been able to find any solution in the demos or on the forums (most posts are either WinForm related or use the deprecated RadDragDropManager). If anyone can shed some line on how I can handle multiple items with the newer DragDropManager that would be great.
Current code is attached.
The entire system as it stands works perfectly for a single GridViewItem but I need to be able to support multiple items. Unfortunately I have not been able to find any solution in the demos or on the forums (most posts are either WinForm related or use the deprecated RadDragDropManager). If anyone can shed some line on how I can handle multiple items with the newer DragDropManager that would be great.
Current code is attached.
private
void
CatalogManageCategoriesProductsDataGrid_OnDragInitialize(
object
sender, DragInitializeEventArgs e)
{
ViewModels.DropIndicationDetails details =
new
ViewModels.DropIndicationDetails();
var GridViewItem = e.OriginalSource
as
GridViewRow ?? (e.OriginalSource
as
FrameworkElement).ParentOfType<GridViewRow>();
var data = GridViewItem !=
null
? GridViewItem.Item : (sender
as
RadGridView).SelectedItem;
var payload = DragDropPayloadManager.GeneratePayload(
null
);
details.CurrentDraggedItem = data;
payload.SetData(
"DraggedData"
, data);
payload.SetData(
"DropDetails"
, details);
e.Data = payload;
e.DragVisual =
new
DragVisual()
{
Content = details,
ContentTemplate = CatalogManageCategoriesProductsDataGrid.Resources[
"ProductDragTemplate"
]
as
DataTemplate
};
e.DragVisualOffset = e.RelativeStartPoint;
}