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

Two expanding parts on one dock?

1 Answer 20 Views
Dock
This is a migrated thread and some comments may be shown as answers.
tentonipete
Top achievements
Rank 1
tentonipete asked on 28 Jan 2009, 01:04 PM
Is it possible to have two maximise/minimise commands on the Dock title bar and two expanding/contracting Dock bodies below?

1 Answer, 1 is accepted

Sort by
0
Nikolay Raykov
Telerik team
answered on 30 Jan 2009, 03:59 PM
Hello Joel,

You could add as much commands as you would like in the title bar of the dock. You could add commands both in code-behind and declaratively.

You could add two ExpandCollapse commands using the following declaration:

<telerik:RadDock ID="RadDock1" runat="server">  
                <Commands> 
                    <telerik:DockExpandCollapseCommand Name="Expand1" Text="Expand" AlternateText="Collapse" OnClientCommand="OnClientCommand" /> 
                    <telerik:DockExpandCollapseCommand Name="Expand2" Text="Expand" AlternateText="Collapse" OnClientCommand="OnClientCommand" /> 
                </Commands> 
                <ContentTemplate> 
                    RadDock1  
                </ContentTemplate> 
            </telerik:RadDock>     

And in the OnClientCommand event handler you could change the state of both commands:

<script type="text/javascript">  
        function OnClientCommand(dock, args)  
        {  
            var commands = dock.get_commands();  
            var state = args.command.get_state();  
            state = state == 1 ? 2 : 1;  
            commands.Expand1.set_state(state);  
            commands.Expand2.set_state(state);  
        }  
    </script> 

Using this approach you could add different types of commands.

For your convenience I have attached an example page which shows this in action.

All the best,

Nikolay Raykov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
tentonipete
Top achievements
Rank 1
Answers by
Nikolay Raykov
Telerik team
Share this question
or