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

Custom Commands on Dynamically Loaded RadDocks

3 Answers 263 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Eric Hsu
Top achievements
Rank 1
Eric Hsu asked on 27 Apr 2007, 06:46 PM
I'm adding RadDocks to my page dynamically, and I need to add a custom command to the toolbar.  There are 2 issues I'm having with this:

    1. Is there  a way to change the icon for my custom command?

    2. Once I add a custom command, the default commands are lost.  I need to have the close and minimize buttons on my control, how can I get these back?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 02 May 2007, 06:42 AM
Hi Eric,

1) To change the icon of the custom command you need to define a CSS style on your page and then set the CssClass property of your custom command. Something like this:
.MyCustomStyle
{
    width:15px;
    background:url(images/custom.gif) repeat-x;
}
...
DockCommand command = new DockCommand();
command.CssClass = "MyCustomStyle";
RadDock1.Commands.Add(command);

The DockToggleCommand has two properties: CssClass and AlternateCssClass for the two states of the command item.

2) By default RadDock will automatically add command items in its Commands collection, if its value was not changed, depending on the value of the DefaultCommands property. When you add a command item in the code behind, or in the ASPX/ASCX, RadDock will not create the default command items. You need to add them explicitly:
DockCommand command = new DockCommand();
command.CssClass = "MyCustomStyle";
RadDock1.Commands.Add(command);
RadDock1.Commands.Add(new DockCloseCommand());
RadDock1.Commands.Add(new DockExpandCollapseCommand());
RadDock1.Commands.Add(new DockPinUnpinCommand());

All the best,
Valeri Hristov (Senior Developer, MCSD)
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
madhu
Top achievements
Rank 1
answered on 18 Jul 2007, 08:04 PM
Hi

I tried to create custom command as shown but custom command does now show with RadDock.

Any Help?

Thanks.
0
Petya
Telerik team
answered on 19 Jul 2007, 09:25 AM
Hi madhu,

I am attaching a simple page demonstrating how to add dock dynamically with a custom command with its own icon plus a movie demonstrating that everything works just fine. If you continue to experience the same problem, then please, send us a simple running page that reproduces the issue and we will work on it.

Best wishes,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
Eric Hsu
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
madhu
Top achievements
Rank 1
Petya
Telerik team
Share this question
or