I have to dynamically load the raddocks oninit depending upon the profile of current User,
I have some link buttons on the page of different users, so I have to updated RadDocs depending upon the selection.
I tried but either it is not updating.
5 Answers, 1 is accepted
Please, ensure that the UniqueName property of RadDock with ID='RadDockDockUnqName3' is unique to RadDockLayout with ID='RadDockLayout1'.
For Deleting I have used following code
// Delete button code
if (RadDockZone1.Docks.Count > 0)
string unqName = "DockUnqName" + a;
RadDock dock = (from s in RadDockZone1.Docks
where s.UniqueName == unqName
dock.Closed = true;
I am adding the Page and Code file. If you can find anything please update me. I first thought it is updatePanel Script error so i commented it, but is coming whenever i Press Add button.
It is not recommended to remove the docks after they have been created earlier in the page life-cycle, because ViewState problems might arise. Instead you should make them invisible (i.e. Visible="false" and Closed="true"), and then create only the Closed="false" (Visible="true) docks in the Page.Init on the next trip to the server.
the Telerik team
But i have the scenario that i have to reload all the Dock zones with Docks dynamically.
When the Page first get loaded I am doing all the Dock loading on page Init.
But as i said I am having drop down that contain users, so depending upon the user selected i have to reload the zones with Docks depending upon the personalization.
i tried something on Delete in one sample Application:
So it was working for me, Even if i Add new dock with same UniqueName then it was allowing me to do with no errors. But in another application i am not even getting the Dock control as a pert of RadDockLayout1.Controls collection. I am not able to understand why at one place Dock control object is part of RadDockLayout and in another it is not.
Can you please update me on this why applications are behaving differently?
I am glad you resolved the issue.
By design the RadDockLayout control requires all registered docks and zones to have different values for their UniqueName properties. I am not sure why you had problems in one of the applications when removing the docks, but in any way it is not related to the RadDockLayout control, because if two docks with identical UniqueName are registered at the same with the Docking Layout, an exception will be thrown.
To remove a dock from the Controls collection of a parent control, you should make sure you are removing it from its direct parent. I suppose, one time the dock is added to the controls collection of the Layout, and other time to the controls collection of the DockingZone. That's why removing it from the zone works in one of the scenarios.
For example in our MyPortal demo when the dock is created for the first time it is added to the zone, and when recreated in the Page.Init event handler it is added to the DockingLayout. If you try to remove it from the RadDockLayout's controls collection, when in fact it is added to the zone, the dock will not be removed.
To avoid similar issues in the future, please make sure you always add the dock to the RadDockLayout, control, and then set the RadDock's DockZoneID property to the ClientID of the zone, where you want to position your dock.
the Telerik team