Ron Trichel
Top achievements
Rank 1
Ron Trichel
asked on 12 Jul 2007, 08:50 PM
Maybe I missed it somewhere but how do I/can I set the image of a custom command. When I've tried to add one to a RadDock all I can get to show up is the "gear" looking circle. For example, I would like to add a custom command for help. I would like this to show an image of a question mark "?".
Also when I add the commands using the following code from an example I found somewhere:
DockCommand command = new DockCommand();
command.AutoPostBack = true;
command.Name = "Command1";
dock.Commands.Add(command);
I lose the Minimize command that is there by default. I do have my RadDock's DefaultCommand set to ExpandCollapse.
Thanks!
Also when I add the commands using the following code from an example I found somewhere:
DockCommand command = new DockCommand();
command.AutoPostBack = true;
command.Name = "Command1";
dock.Commands.Add(command);
I lose the Minimize command that is there by default. I do have my RadDock's DefaultCommand set to ExpandCollapse.
Thanks!
6 Answers, 1 is accepted
0
Hi Ron,
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) no-repeat;
}
...
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());
Best Regards,
Petio Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Ron Trichel
Top achievements
Rank 1
answered on 13 Jul 2007, 02:51 PM
That did it...
Thanks!
Thanks!
0
Geert-Jan
Top achievements
Rank 1
answered on 15 May 2009, 02:37 PM
Got the latest version Q1 2009 SP1.
This doesn't work. For every custom command I add a style I get the collapse icon. I'm using IE8.
This doesn't work. For every custom command I add a style I get the collapse icon. I'm using IE8.
0
Obi-Wan Kenobi
Top achievements
Rank 1
answered on 18 May 2009, 07:41 AM
You should override the default styles- set !important, e.g.
.MyCustomStyle
{
width:15px !important;
background:url(images/custom.gif) no-repeat !important;
}
.MyCustomStyle
{
width:15px !important;
background:url(images/custom.gif) no-repeat !important;
}
0
Wayne
Top achievements
Rank 1
answered on 17 Jun 2009, 04:00 PM
I am having this same issue. I have added the !important tags to my styles (see below)
.deleteCommand |
{ |
width:15px !important; |
background:url(images/1_5/basic_set/delete_16.png) no-repeat !important; |
} |
Before I added the important tag all of my images had changed from gears to the expand/collapse icon. Once I added the important tag all of the images went away completely and the new ones are still not showing up. I also tried changing the width to 16px since that is the size of my image but it didn't help.
Here is the code I am using to create the command:
DockCommand rdocDelete = new DockCommand(); |
rdocDelete.Name = "del@@@" + KPI_ID + "@@@" + CUBENAME; |
rdocDelete.CssClass = "deleteCommand"; |
rdocDelete.OnClientCommand = "DeleteKPI"; |
rdocDelete.Text = "CLICK HERE TO DELETE THIS KPI VIEW."; |
dockableObject.Commands.Add(rdocDelete); |
Thanks in advance for your help!
Wayne
0
Hello Wayne,
Everything in you code looks fine. May I ask you to open the support ticket and send us running project, where we can observe the problem? Once we receive it, we'll do our best to help you.
Greetings,
Petko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Everything in you code looks fine. May I ask you to open the support ticket and send us running project, where we can observe the problem? Once we receive it, we'll do our best to help you.
Greetings,
Petko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.