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

RadDock + RadUpdatePanel does not seem to fire OnClientInitialize

3 Answers 60 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 02 Feb 2009, 07:58 PM
Hi there,

So here's my situation:

I'm dynamically adding RadDocks on the server-side, and for each RadDock I create, I set its OnClientInitialize property to a JS function as shown in the examples so that I can use an image as the drag handle.  The RadDocks are inside a RadAjaxPanel, and I'm forcing an update of the panel through javascript.  Everything renders properly, but I've lost the ability to drag and drop my docks.  I've put in a couple of alerts and it seems that after the Ajax postback, the OnClientInitialize isn't being called.

Any help would be greatly appreciated.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 03 Feb 2009, 09:03 AM
RadDock is not a regular control and you couldn't update floating RadDock using this approach.
If you want to update RadDock via Ajax, You should also update all RadDockZones while all RadDocks are docked.
On the links below you can find several examples which illustrates how the RadDock control could be used with AJAX:
 - http://demos.telerik.com/aspnet-ajax/dock/examples/autopostback/defaultcs.aspx
 - http://demos.telerik.com/aspnet-ajax/dock/examples/dynamicdocks/defaultcs.aspx
 - http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx (dynamically add RadDocks and save their state)
0
Dan
Top achievements
Rank 1
answered on 03 Feb 2009, 01:53 PM
Hi Obi-Wan, thanks for your response.  Just to clarify, the AjaxPanel is the RadAjaxPanel and the panel is actually updating the RadDocZone which contains the RadDocks.  I've looked at the examples you posted and will give those a go.

Curiously, all the examples use a hidden updatepanel outside of the dockzones but inside of the RadDocLayout.  Why does this work and not just a straight ajax update of the RadDocZone?
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 03 Feb 2009, 02:12 PM

"The problem is related to update a floating RadDock with AJAX. When dragging the dock you move it outside the update panel and this causes AJAX not working properly as it attempts to recreate the dock at the place it was previously located and  the dock is moved to the new place and stays there. In this way two docks with the same id appear on the page and this leads to an exception.
This is a common problem of controls which can be moved in the DOM tree."

Hope this helps!

Tags
Dock
Asked by
Dan
Top achievements
Rank 1
Answers by
Obi-Wan Kenobi
Top achievements
Rank 1
Dan
Top achievements
Rank 1
Share this question
or