Droping onto ListBox or Nested ListBoxItem Control

3 posts, 0 answers
  1. Ryan
    Ryan avatar
    7 posts
    Member since:
    Aug 2011

    Posted 13 Sep 2011 Link to this post

    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. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 15 Sep 2011 Link to this post

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

  3. DevCraft banner
  4. Ryan
    Ryan avatar
    7 posts
    Member since:
    Aug 2011

    Posted 15 Sep 2011 Link to this post

    thanks i have appended a small solution in my ticket
Back to Top