Drag and Drop within Listbox

11 posts, 0 answers
  1. Anthony Pieper
    Anthony Pieper avatar
    8 posts
    Member since:
    Jul 2009

    Posted 02 Nov 2009 Link to this post

    We have two listboxes that we currently can drag and drop between. When dragging the arrow appears to show which listbox you are dragging from and dragging to, which is what we want.

    We need to know have a listbox drag within itself (not a treeview). There is an example in the forum, however it is using a Style to set the appearance of the listbox, we don't want to use a Style, but assign it directly in the xaml of the listbox. We need to have it look like the horizontal bar when dragging between items, how can I acheive this?

    I'm not sure if this matters, but our listbox is populated using a linq query.
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 04 Nov 2009 Link to this post

    Hi Anthony Pieper,

    Please find attached two sample projects that shows how to accomplish the desired functionality.
    1.The first example is without a custom Style and AllowDropProperty is set in code.

               this.listBox1.SetValue(RadDragAndDropManager.AllowDropProperty,true);
                this.listBox2.SetValue(RadDragAndDropManager.AllowDropProperty,true);

    2.The second one contains a custom  Style for ListBox.

    I hope that this will be helpful.


    Sincerely yours,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Alan
    Alan avatar
    47 posts
    Member since:
    Jun 2009

    Posted 01 Mar 2010 Link to this post

    Do you have a similar example that shows how to drag/drop/reorder with a ListBox that is oriented horizontally instead of vertically?  I can get the items to appear horizontally, but I can't figure out how to position the DropCueElement so that the dark gray bar will appear correctly between items.

    Here is the setter that I've added to the ListBox style in order to get the items to appear horizontal in the ListBox:

    <Setter Property="ItemsPanel"
                    <Setter.Value> 
                        <ItemsPanelTemplate> 
                            <StackPanel Orientation="Horizontal" 
                              VerticalAlignment="Stretch" 
                              HorizontalAlignment="Left"/> 
                        </ItemsPanelTemplate> 
                    </Setter.Value> 
                </Setter> 

    Any suggestions?  Thanks.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 03 Mar 2010 Link to this post

    Hi Alan,

    I modified the example so that it will work with horizontal ListBoxes.

    Hopefully this is what you need,

    Best wishes,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Alan
    Alan avatar
    47 posts
    Member since:
    Jun 2009

    Posted 03 Mar 2010 Link to this post

    Yes, this is great!  Thank you.
  7. Flemming Rosenbrandt
    Flemming Rosenbrandt avatar
    119 posts
    Member since:
    Mar 2006

    Posted 07 Apr 2010 Link to this post

    Is reordering of items on the roadmap for DragAndDropManager? Silverlight Toolkit has it out of the box..

     

    /Flemming Rosenbrandt

  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 12 Apr 2010 Link to this post

    Hello Flemming Rosenbrandt,

    Can you send us an example where this is out of the box. Thanks!

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Flemming Rosenbrandt
    Flemming Rosenbrandt avatar
    119 posts
    Member since:
    Mar 2006

    Posted 13 Apr 2010 Link to this post

    Hi

     

    The Silverlight Toolkit Drag and Drop example has a listbox where you can rearrange the items.

     

    http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html

     

    /Flemming Rosenbrandt

  10. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 Apr 2010 Link to this post

    Hi Flemming Rosenbrandt,

    It is not out of the box, but I see your point. We will see how to make it simpler with the Telerik drag and drop manager.

    Sincerely yours,
    Valentin.Stoychev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  11. Robert Staniskis
    Robert Staniskis avatar
    3 posts
    Member since:
    Apr 2010

    Posted 07 Jul 2010 Link to this post

    Hi,

    I know this thread is a few months old, but I thought I would share with you all that the Silverlight Toolkit drapdrop functionality DOES NOT work when your silverlight xap file is running in the FireFox or Safari browser.  I also verified that the Telerik drag drop functionality DOES work in these scenarios.  I had been using the Silverlight Toolkit's drag drop until I discovered the issue with it.

    While the Telerik soltution to drag drop is not as simple to implement as the Control Toolkit, I am so glad that is works in all browsers!

    Thanks guys,

    Robert
  12. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 12 Jul 2010 Link to this post

    Hello Robert Staniskis,

    Thank you for the feedback. We highly appreciate any comments and suggestions on the matter.

    Also, if we can assist you in implementing DragAndDrop scenarios using the RadDragAndDropManager, please do not hesitate to contact us. We will be more than happy to assist you in any way we can.

    Thank you again.

    All the best,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner