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

Removing One or More RadDocks after each other

2 Answers 30 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 17 May 2012, 07:54 AM
Hi,
I am using this Demo to add and remove different docks dynamically. The RadDockZone and RadDockLayout won't be changed so only the docks are dynamically created.

Everything works fine when adding docks and even if I remove a dock and then add a new dock. The problem occurs when I close more than one dock after the other, they dissapear as they should, but then when I add a new one the most recent one created from the closed ones re-appers along with the new one just created.

If you try it in your demo page the problem is that the page redirects to a Page Not Found page. I can't figure out whats the problem

Can you kindly help me.

2 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 21 May 2012, 02:13 PM
Hi Michael,

Indeed, there is a problem when an Ajax request is initiated after two or more RadDocks are closed. Please modify your code, using the following sample, in order to ensure that the user control is not loaded when a RadDock is closed:
protected void Page_Init(object sender, EventArgs e)
{
    //Recreate the docks in order to ensure their proper operation
    for (int i = 0; i < CurrentDockStates.Count; i++)
    {
 
        RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);
        //We will just add the RadDock control to the RadDockLayout.
        // You could use any other control for that purpose, just ensure
        // that it is inside the RadDockLayout control.
        // The RadDockLayout control will automatically move the RadDock
        // controls to their corresponding zone in the LoadDockLayout
        // event (see below).
        RadDockLayout1.Controls.Add(dock);
        //We want to save the dock state every time a dock is moved.
        CreateSaveStateTrigger(dock);
        //Load the selected widget
        if (CurrentDockStates[i].Closed == true)
        {
            dock.Visible = false;
        }
        else
        {
            LoadWidget(dock);
        }
    }
}

This issue will be resolved with a future update of the My Portal online demo.

Regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Michael
Top achievements
Rank 1
answered on 25 May 2012, 08:48 AM
Thanks a lot Slav :)
Tags
Dock
Asked by
Michael
Top achievements
Rank 1
Answers by
Slav
Telerik team
Michael
Top achievements
Rank 1
Share this question
or