Avoid multiple DockPositionChanged events

3 posts, 1 answers
  1. Stanislav
    Stanislav avatar
    5 posts
    Member since:
    Jun 2008

    Posted 01 Jul 2011 Link to this post

    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,
  2. Answer
    Slav avatar
    1351 posts

    Posted 04 Jul 2011 Link to this post

    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.

    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.

  3. DevCraft R3 2016 release webinar banner
  4. Stanislav
    Stanislav avatar
    5 posts
    Member since:
    Jun 2008

    Posted 05 Jul 2011 Link to this post

    Thanks, Slav. Will try.
Back to Top