RadPanelBar - Dragging Items Out

2 posts, 0 answers
  1. Enal
    Enal avatar
    39 posts
    Member since:
    Oct 2011

    Posted 13 Oct 2011 Link to this post

    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/>

  2. Enal
    Enal avatar
    39 posts
    Member since:
    Oct 2011

    Posted 17 Oct 2011 Link to this post

    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.
  3. DevCraft banner
Back to Top