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

Dynamic RadDock Ajax PostBack for DockPositionChanged

1 Answer 111 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 11 Sep 2008, 05:05 PM
Using Q2, I am creating Dynamic Docks in the Page_Init event, and for that Dock, I am setting AutoPostBack to true and setting the DockPositionChanged event handler to an appropraite event handler.

I have no problems with the dock as it moves around as it will postback and call the event, but the problem is the postback is a full page postback and not just the dock. I just want the dock to call the server-side event handler so that I can make the appropraite changes to the layout in the server cache.

I have tried a couple of things, dynamically adding AjaxSettings for the dock control (this throws all kinds of JavaScript errors), adding the DockZone as a Setting (locks the zone and docks up), and adding the DockLayout as a Setting (works, but causes a lot of flash and loses its client-sized dimensions).

Please let me know how to make the calls "Ajax" calls as I have searched the forums and looked through the demos and have not found an example that matches what I need to do.

I have removed any user controls from the dock, so it is an empty dock that causes this problem.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dennis
Top achievements
Rank 1
answered on 12 Sep 2008, 03:55 PM
Ok, I think I solved it. In a hidden div, I added an empty asp:UpdatePanel with Conditional mode. When I create the dynamic docks, I add each dock to the UpdatePanel as a AsyncPostBackTrigger. This performs the postback as expected using Ajax without a full page load.

I won't be able to update content, but I don't need to update content. I needed to just be able to track the user changes to the docks for later creating.

AsyncPostBackTrigger widgetTrigger = new AsyncPostBackTrigger ();

widgetTrigger.ControlID = currentWidget.WidgetId;

WidgetDockUpdatePanel.Triggers.Add (widgetTrigger);

Tags
Dock
Asked by
Dennis
Top achievements
Rank 1
Answers by
Dennis
Top achievements
Rank 1
Share this question
or