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

Restrict number of docks per zone

1 Answer 78 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Craig Gundlach
Top achievements
Rank 1
Craig Gundlach asked on 23 May 2008, 11:56 PM
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

1 Answer, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 26 May 2008, 08:21 AM
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
Tags
Dock
Asked by
Craig Gundlach
Top achievements
Rank 1
Answers by
Sophy
Telerik team
Share this question
or