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

Causing error when clearing docks from buttonClick event

3 Answers 76 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael Bordogna
Top achievements
Rank 1
Michael Bordogna asked on 02 Nov 2007, 06:16 PM

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++;
}

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 06 Nov 2007, 09:56 AM
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
0
Michael Bordogna
Top achievements
Rank 1
answered on 06 Nov 2007, 07:07 PM
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.
0
Petya
Telerik team
answered on 07 Nov 2007, 01:39 PM
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
Tags
Dock
Asked by
Michael Bordogna
Top achievements
Rank 1
Answers by
Petya
Telerik team
Michael Bordogna
Top achievements
Rank 1
Share this question
or