Restrict number of docks per zone

2 posts, 0 answers
  1. Craig Gundlach
    Craig Gundlach avatar
    3 posts
    Member since:
    Mar 2007

    Posted 23 May 2008 Link to this post

    Is there a way to "lock" a zone once a pre-determined number of docks have been moved into it? I tried setting enabled = false once the zone.docks.count hits a certain number but I can still add more docks into it after disabling. TIA
  2. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 26 May 2008 Link to this post

    Hi Craig,

    The RadDockZone does not provide a property which can be set to lock the zone if a predetermined limit of docks have already been docked in it. If you want to avoid users dropping docks in a zone in which there already are a predetermined number of docks I could suggest you use the OnClientDragStart and the OnClientDragEnd client events to do the check. At the OnClientDragStart you can save the dock's current parent zone and at OnClientDragEnd check the number of docks of the zone in which the dock is just dropped and if it is greater than the predetermined limit for the corresponding zone return the just dropped dock to its previous location.
    If you want to dock a dock object in a zone with javascript code if the docks in the zone do not exceed the predetermined limit you can do the check just before the code which docks the dock.

    Let us know if you need further assistance.

    Greetings,
    Sophy
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top