Removing One or More RadDocks after each other

3 posts, 0 answers
  1. Michael
    Michael avatar
    4 posts
    Member since:
    Jun 2011

    Posted 17 May 2012 Link to this post

    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. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 21 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Michael
    Michael avatar
    4 posts
    Member since:
    Jun 2011

    Posted 25 May 2012 Link to this post

    Thanks a lot Slav :)
Back to Top