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
40
How to fix a specific panel so that no other panels can be attached or docked into the specific panel?
posted

I am currently using ultradockmanager to set up several panels for customizable docking and attaching to other panels on Windows form.
The problem is that there is a specific panel that should not be allowed to move, attached, nor docked, while other panels are allowed.
It means that the size of the specific panel should be unchangable, and it must not be attached nor docked by other panels.
Is there any way to setup that specific panel?  I'm wondering if there is any control property for this.

Actually it happened because of the fact that UltraFormManager and UltraToolbarManager could not be used at the same time.
I was looking for workaround, and was able to do it by placing ultratoolbarmanager on panel first,
then placing it to the top docking of the form by ultradockmanager.
It seemed to work fine, but the above problem occurred.

If UltraFormManager and UltraToolbarManager can be used at the same time, there would be no problem at all.

Thank you in advance for the answer.
Sincerely,

Parents
No Data
Reply
  • 48586
    posted

    Hello ,

     

    First of all I would like to ask why you need to use FormManger and ToolbarsManager on same form. You should be able to achieve the same from look with UltraToolbarsManager. So it will be easy of you just mage to get the same look with UltraToolbarsManager.

     

    You should use PaneSettings object of the corresponding control pane in order to disallow dragging, floating and etc. (see Allow* properties)

     

    http://help.infragistics.com/Help/Doc/WinForms/2015.1/CLR4.0/html/Infragistics4.Win.UltraWinDock.v15.1~Infragistics.Win.UltraWinDock.PaneSettings_members.html

     

    and if you need to disallow any pane to be docked within that pane you should handle BeforeDockChange event and use code like the following there:

     

    private void ultraDockManager1_BeforeDockChange(object sender, Infragistics.Win.UltraWinDock.BeforeDockChangeEventArgs e)

            {

                DockablePaneBase targetPane = GetSublaing();

     

                if (e.ChangeType == Infragistics.Win.UltraWinDock.DockChangeType.NewGroup && this.ultraDockManager1.PaneFromControl(this.panel1).Equals(targetPane) )

                    e.Cancel = true;

            }

     

            public DockablePaneBase GetSublaing()

            {

                var dragManagerInfo = typeof(UltraDockManager).GetProperty("DragManager", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance);

                var dragManager = dragManagerInfo.GetValue(this.ultraDockManager1);

                if (dragManager == null)

                    return null;

                var dropLocationInfo = dragManagerInfo.PropertyType.GetField("dropLocation", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance);

                var dropLocation = dropLocationInfo.GetValue(dragManager);

                if (dropLocation == null)

                    return null;

                var dropInfoInfo = dropLocationInfo.FieldType.GetField("dropInfo", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance);

                var dropInfo = dropInfoInfo.GetValue(dropLocation);

                if (dropInfo == null)

                    return null;

                var subLingPaneInfo = dropInfoInfo.FieldType.GetField("NewSibling");

                return  subLingPaneInfo.GetValue(dropInfo) as DockablePaneBase;

            }

     

     

    However I

Children
No Data