Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
665
Drag&Drop UltraToolBarsManager
posted

Hi there,

is it possible to use the Drag&Drop Funcion with the UltraToolBarsManager? First i did it with the UltraTree using the DoDragDrop-Function but this one does not exist on UltraToolBarsManager.

What must i do to use Drag&Drop with the UltraToolBarsManager?

regards

Cloud

Parents
  • 53790
    posted

    Hello Could,

    I`m not sure what you mean with drag and drop functionality in UltraToolbarManager, but if you want to move the tools from one UltraToolbarManager to another UltraToolbarManager with drag and drop, then maybe you could used the code:

    private void ultraToolbarsManager1_ToolbarModified(object sender, Infragistics.Win.UltraWinToolbars.ToolbarModifiedEventArgs e)

    {

        if (e.ToolbarChangeType == ToolbarChangeType.EndDrag)

        {

            UltraToolbar ut = null;

     

            if (((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Toolbars.Exists(e.Toolbar.Key))

            //if (((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Toolbars[e.Toolbar.Key].Key == e.Toolbar.Key)

            {

                ut = ((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Toolbars[e.Toolbar.Key];

            }

            else

            {

                ut = ((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Toolbars.AddToolbar(e.Toolbar.Key);

            }

            ut.Visible = true;

            ut.DockedPosition = DockedPosition.Top;

     

            while (ultraToolbarsManager1.Toolbars[e.Toolbar.Key].Tools.Count > 0)

            {

                ToolBase tb = ultraToolbarsManager1.Toolbars[e.Toolbar.Key].Tools[0];

                ultraToolbarsManager1.Tools.Remove(tb);

                ultraToolbarsManager1.Toolbars[e.Toolbar.Index].Tools.Remove(tb);

                ((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Tools.Add(tb);

                ((Form2)this.ActiveMdiChild).ultraToolbarsManager1.Toolbars[ut.Key].Tools.AddTool(tb.Key);

     

            }

            if (ultraToolbarsManager1.Toolbars[e.Toolbar.Key].Tools.Count == 0)

            {

                ultraToolbarsManager1.Toolbars[e.Toolbar.Key].Visible = false;

            }

        }

    }

     

     

     

    Please take a look at the attached sample and video file for more details and let me know if you have any questions or if you think that I misunderstood your question.

    Regards

     

     

Reply Children