Reordering ToolBars in the ToolBarTray

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    10 posts
    Member since:
    Jul 2012

    Posted 15 Aug 2012 Link to this post

    I have a WPF application with a ToolBarTray with several toolbars. I want to allow users to drag them around to re-order them to their liking.

    I have gotten as far as capturing the OnDragDropCompleted event (using RadDragDropManager) but cannot figure out how to reorder the toolbars.

    I presume I need to remove the toolbars from the toolbartray items collection then add them back in the new order, but need some help.

    I am very surprised that this isn't a starndard feature of the ToolbarTray component, as is seems like base functionality to me.

    Regards,

    Kevin
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Aug 2012 Link to this post

    Hi Kevin,

    Unfortunately the RadToolBars cannot be reordered through drag-and-drop out-of-the-box. However, we've logged this task in our to-do list and you can track its progress here.

    In the meantime you can use the DragDropManager to implement custom drag reordering behavior. I am not sure what reordering logic you'd like to see in your solution but I attached a sample solution to get you started. It basically allows you to drag a toolbar and drop it next to the item, the drop happens over. Let me know if that helps.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kevin
    Kevin avatar
    10 posts
    Member since:
    Jul 2012

    Posted 20 Aug 2012 Link to this post

    Tbanks for the sample.

    I had already figured out how to drag and drop with a single band, or from one band to another, but the real functionality I'm looking for is to be able to create a new band by dragging off the current band (essentially off the toolbar).

    This is a common requirement when shrinking a window down such that the toolbars no longer fit in the window. RadToolBar's overflow area is OK, but doesn't provide the user experience my customers are accustomed to.

    Thanks
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 Aug 2012 Link to this post

    Hello Kevin,

    I extended the solution to drag the ToolBars in and outside the ToolBarTray. The logic is specifically designed for the sample solution and you might need to modify it to better fit your requirements but it can be a good starting point.

    Let me know if I can further assist you.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top