This is a migrated thread and some comments may be shown as answers.

RadPanelBar - Dragging Items Out

1 Answer 83 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Enal
Top achievements
Rank 1
Enal asked on 13 Oct 2011, 05:36 PM
Hi,

Context:

I am trying to replace a toolkit Accordion with a RadPanelBar. The Accordion contains ListBoxes. ListBoxItems can be dragged out and be dropped onto a Grid. Think of it as a Tool Box with Tools to be dragged onto a work space. This works fine with DragDropManager. I am rendering an Image as DragVisual and all looks good. (note: This is using the new DragDropManager, not RadDragAndDropManager)

Enter RadPanelBar:

Drag & Drop stops functioning once the Accordion is replaced with a RadPanelBar. RadPanelBar seems to insist that I want to drag between its panels and overrides the DragVisual and renders the class name with a little icon below. How can I disable this behavior and use my own visuals?

If I set IsDragDropEnabled=false it also disables Drag on the ListBoxItems, which have DragDropManager.AllowDrag=true and DragDropManager.AllowCaptureDrag=true. Events are registered with  DragDropManager.AddDragInitializeHandle etc. I reveive the DragInitialize event but nothing else.

As a simple example: Could you please show how to set up the following RadPanelBar so it is possible to drag the ListBoxItems out and drop them into a Grid (or other basic control) while displaying a drag cue that visualizes the ListBoxItem with image?

Thanks!


<telerik:RadPanelBar x:Name="TestPanelBar">
    <telerik:RadPanelBarItem Header="TestPanel">
        <ListBox Name="TestBox">
            <ListBoxItem Name="TestItem_1">
                <Image  Source="/TestProject;component/Images/image_1.png" />
            </ListBoxItem>
            <ListBoxItem Name="TestItem_2">
                <Image  Source="/TestProject;component/Images/image_2.png" />
            </ListBoxItem>
        </ListBox>
    </telerik:RadPanelBarItem>
<telerik:RadPanelBar/>

1 Answer, 1 is accepted

Sort by
0
Enal
Top achievements
Rank 1
answered on 17 Oct 2011, 04:43 PM
Looks like I figured it out. Setting Handled=true on the D&D event stops TK from taking over and lets me do what I want.
Tags
PanelBar
Asked by
Enal
Top achievements
Rank 1
Answers by
Enal
Top achievements
Rank 1
Share this question
or