Causing error when clearing docks from buttonClick event

4 posts, 0 answers
  1. Michael Bordogna
    Michael Bordogna avatar
    9 posts
    Member since:
    Apr 2006

    Posted 02 Nov 2007 Link to this post

    Whenever i try to clear the dock objets from the layout it clears them but it through a page cannot be null error. The code i am using for the button click is below. the rest of the page code is identical to the dynamic docks code from the cfm help file.

    int
    pos=0;
    RadDock d;
    while( RadDockLayout1.Controls.Count > pos)
    {
        d = RadDockLayout1.Controls[pos]
    as RadDock;
        if (d != null)
        {
            RadDockLayout1.Controls.Remove(d);
            lblOutput.Text +=
    "Removing Part<br />";
        }
        else pos++;
    }

  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 06 Nov 2007 Link to this post

    Hello Michael Bordogna,

    We need some more information to be able to assist you with this problem - what exactly do you need this piece of code for, what do you expect to take place by removing the docks from the RadDockLayout? Please, provide as many details as possible so we can provide accurate assistance.

    Sincerely yours,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Michael Bordogna
    Michael Bordogna avatar
    9 posts
    Member since:
    Apr 2006

    Posted 06 Nov 2007 Link to this post

    the scenerio is as follows, the User will click a button to clear his customized part page. By clicking the "clear" button the applicaiton will do a callback and close/remove all raddocks from the page and server session memory.
    Some docks in my application will be required to have a zone as a parent and other will require that they don't have a zone as a parent and will always be floating. there will never be a dock in my applicaitons that can dock and be floating.
    So base on my initial assessment the Radlayout should have a reference to all docks regardless of which zone is their parent.
  4. Petya
    Admin
    Petya avatar
    869 posts

    Posted 07 Nov 2007 Link to this post

    Hi Michael Bordogna,

    I am attaching our Dynamically Created Docks online demo again this time enhanced to include a Clear Docks button. In the button handler I register a script for each dock that will place it inside a hidden div element within the update panel to mimic what happens when the Close command button of RadDock is clicked in the example. In the code the docks are added initially floating to the RadDockLayout which conforms with your requirements. Let me know if you have other problems.

    Greetings,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top