Edit mode and live mode

2 posts, 0 answers
  1. Eddie Conner
    Eddie Conner avatar
    32 posts
    Member since:
    Dec 2009

    Posted 19 Aug 2011 Link to this post

    i am working on creating a page that when is in edit mode, the RadDockLayout, RadDockZones and RadDocks will dynamically be loaded. The user will be able to add controls, drag and drop etc. However, when in live mode I of course do not want the RadDock features.  I still want to use RadDock features to load the zones from state and locate the docks from the state. However, when the page is rendered, I do not want the docking abilities in live mode.

    What is the best practice to disable for live mode?
  2. Slav
    Slav avatar
    1359 posts

    Posted 24 Aug 2011 Link to this post

    Hello Eddie,

    If I understand your case correctly, in live mode you want your RadDocks to be static. For example they shouldn't be dragable and no command should be active, in order to deny the user closing or collapsing/expanding the docks.

    The RadDock control has a property EnableDrag, which set to false, disables the dragging the docks. When you disable the dragging feature, moving and docking the RadDocks will no longer be available.

    You can also hide the commands in the title bar, especially the close command, so that the RadDocks cannot be closed, when live mode is active. For this purpose you can set the DefaultCommands property of the RadDock to None, if you want to hide all commands:
    RadDock1.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;

    You can also specify the exact commands to be displayed, by using the same property, as show below:
    RadDock1.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.ExpandCollapse | Telerik.Web.UI.Dock.DefaultCommands.Close;

    Another approach to specify a custom set of commands is to add them to the Commands collection of the RadDock. This method will override the commands, set via the DefaultCommands property.
    RadDock1.Commands.Add(new DockCloseCommand());
    I hope the provided information helps. Please let us know if you need additional assistance in order to achieve the desired functionality.

    Kind regards,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top