Ejemplo n.º 1
0
        private void OnDragInitialize(object sender, DragInitializeEventArgs e)
        {
            var source = e.OriginalSource as FrameworkElement;
            if (source != null && source.Name != "PART_RowResizer")
            {
                GridRowIndicationDetail details = new GridRowIndicationDetail();
                var item = (sender as RadGridView).SelectedItem;
                details.CurrentDraggedItem = item;

                IDragPayload dragPayload = DragDropPayloadManager.GeneratePayload(null);

                dragPayload.SetData("DraggedItem", item);
                dragPayload.SetData("DropDetails", details);

                e.Data = dragPayload;

                e.DragVisual = new DragVisual()
                {
                    Content = details,
                    ContentTemplate = this.AssociatedObject.Resources["DraggedItemTemplate"] as DataTemplate
                };
                e.DragVisualOffset = e.RelativeStartPoint;
                e.AllowedEffects = DragDropEffects.All;
            }
        }
Ejemplo n.º 2
0
        private void OnDragInitialize(object sender, DragInitializeEventArgs e)
        {
            GridRowIndicationDetail details = new GridRowIndicationDetail();
            var items = (sender as RadListBox).SelectedItems;
            details.CurrentDraggedItem = items;

            IDragPayload dragPayload = DragDropPayloadManager.GeneratePayload(null);

            dragPayload.SetData("DraggedData", items);
            dragPayload.SetData("DropDetails", details);

            e.Data = dragPayload;

            e.DragVisual = new DragVisual()
            {
                Content = details,
                ContentTemplate = this.AssociatedObject.Resources["DraggedItemTemplate"] as DataTemplate
            };
            e.DragVisualOffset = e.RelativeStartPoint;
            e.AllowedEffects = DragDropEffects.All;
        }