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

Droping onto ListBox or Nested ListBoxItem Control

2 Answers 76 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 13 Sep 2011, 11:34 PM

Hi,

First of all great silverlight component suite its helped a great deal nice work guys.

I am having an issue with Drag Drop functionality, I need to drop an Item from One ListBox to another but i also need the ability to drop into a ListBoxItem that has a nested Control (at this point another listbox but will be a custom control later).

at the moment i have the drop before drop after and reorder functionality working well but cant seem to drop into the nested ListBox.

private void OnDropInfo(object sender, DragDropEventArgs e)
    {
        if (e.Options.Status == DragStatus.DropPossible)
        {
            var listBox = e.Options.Destination.FindItemsControlParent() as ListBox;

i think that im going wrong in the code above but cant quite see how to achieve both drop before/after and into.

the visual state manager is able to target the nested listbox and transition into a "droppossible State" (border colour change) but items are added to the Root ListBox and not the listbox nested in the listBoxItem below the cursor at the time.

Thanks for your time

Ryan

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 15 Sep 2011, 12:19 PM
Hello Ryan,

 From the information provided we can speculate the problem you are facing is related to the fact that DropQuery/Info are bubble events and thus the events bubble to the parent listbox. What we can suggest is to handle events in the child listbox (e.Handled=true). 

However, if this does not help, would ti be possible to share some additional information about the implementation (sample project or xaml+code behind). You can attach projects by opening support ticket.

Greetings,
Tsvyatko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ryan
Top achievements
Rank 1
answered on 16 Sep 2011, 02:30 AM
thanks i have appended a small solution in my ticket
Tags
DragAndDrop
Asked by
Ryan
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or