Disabling Floating in Child form

4 posts, 0 answers
  1. Mark
    Mark avatar
    10 posts
    Member since:
    May 2016

    Posted 12 Dec 2016 Link to this post

    I have a radform with 3 panels. The middle panel displays the initial window and any called child forms as this is the mdi parent. I found I could disable floating in each window by placing the following code:

            this-object:radcenterWindow:AllowedDockState = Telerik.WinControls.UI.Docking.AllowedDockState:All and not Telerik.WinControls.UI.Docking.AllowedDockState:Floating.

     

    How can I disable floating on any loaded child form?

            define variable r-object as class Telerik.WinControls.UI.RadForm.

            define variable r-program as character no-undo.
            r-program = "programs.POSPRO".
            r-object = dynamic-new r-program().
            r-object:MDIParent = this-object.
            r-object:show().

     

    Thanks

    Mark

  2. Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 13 Dec 2016 Link to this post

    Hi Mark,

    Thank you for writing.

    It seems that you are adding RadForm instances as MDI children in RadDock. You can apply the approach below to any window loaded in RadDock. For the purpose, you would need to handle the DockStateChanging event and cancel it depending on the state and the window:
    public RadForm1()
    {
        InitializeComponent();
     
        this.IsMdiContainer = true;
        this.radDock1.AutoDetectMdiChildren = true;
        this.documentWindow2.AllowedDockState = Telerik.WinControls.UI.Docking.AllowedDockState.TabbedDocument;
     
        this.radDock1.DockStateChanging += radDock1_DockStateChanging;
    }
     
    private void radDock1_DockStateChanging(object sender, Telerik.WinControls.UI.Docking.DockStateChangingEventArgs e)
    {
        if (e.NewDockState == Telerik.WinControls.UI.Docking.DockState.Floating && e.NewWindow.Name == "documentWindow1")
        {
            e.Cancel = true;
        }
    }

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Mark
    Mark avatar
    10 posts
    Member since:
    May 2016

    Posted 13 Dec 2016 in reply to Hristo Link to this post

    Thanks Hristo,

    I'm using Openedge, could you convert this code to Openedge?

     

  4. Hristo
    Admin
    Hristo avatar
    1517 posts

    Posted 15 Dec 2016 Link to this post

    Hello Mark,

    Thank you for writing.

    You can subscribe to the event from the Events in the designer. You can cancel for all windows with a new DockState = Floating
    METHOD PRIVATE VOID radDock1_DockStateChanging( INPUT sender AS System.Object, INPUT e AS Telerik.WinControls.UI.Docking.DockStateChangingEventArgs ):
            IF e:NewDockState = Telerik.WinControls.UI.Docking.DockState:Floating Then DO:
                 e:Cancel = TRUE.
            END.
             
            RETURN.
     
    END METHOD.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top