This is a migrated thread and some comments may be shown as answers.

Disabling Floating in Child form

3 Answers 87 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 12 Dec 2016, 06:33 PM

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

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 13 Dec 2016, 11:50 AM
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.
0
Mark
Top achievements
Rank 1
answered on 13 Dec 2016, 03:36 PM

Thanks Hristo,

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

 

0
Hristo
Telerik team
answered on 15 Dec 2016, 02:35 PM
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.
Tags
Dock
Asked by
Mark
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Mark
Top achievements
Rank 1
Share this question
or