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

Avoid multiple DockPositionChanged events

2 Answers 43 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Stanislav
Top achievements
Rank 1
Stanislav asked on 01 Jul 2011, 08:01 AM
Hi there,

Let's imagine, that we have five docked controls in one dock zone and five in second. If I move the top docked control from one zone into another I get 10 dockpositionchanged handler executions. Because I have some custom logic after each execution, handled agains database, this cause 10 executions of stored procedure behind, instead of one. Is there any way to allow this handler to be executed only for docked control currently dragged or may be any property, that might help to determine the dragged control and skip others. Thanks.

With best regards,
Stanislav

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 04 Jul 2011, 03:57 PM
Hi Stanislav,

Currently the RadDock doesn't support such a feature, but it will be implemented in future release of the RadControls for ASP.NET AJAX. Nonetheless, there is a workaround for this case, described below:

1 HiddenField control, which will store in its value the id of the dragged RadDock, is added to the page.

2.Through OnClientDockPositionChanging client-side event of RadDock, which fires for the dragged dock only, the Id is stored in the HiddenField.

3. When server-side event DockPositionChanged is handled, the value of the HiddenField and the Id of the moved RadDock are compared and if they match, the main logic can be executed.

I have attached a sample project, demonstrating the suggested solution.

Regards,
Slav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Stanislav
Top achievements
Rank 1
answered on 05 Jul 2011, 02:00 PM
Thanks, Slav. Will try.
Tags
Dock
Asked by
Stanislav
Top achievements
Rank 1
Answers by
Slav
Telerik team
Stanislav
Top achievements
Rank 1
Share this question
or