Anyone have any suggestions on how to add a dock command server-side. I'm creating the commands on the fly and want to add a "reload" button (there is one on the RadWindow) and then handle that myself. But I can't seem to create a DockCommand.
Telerik.Web.UI.DockCommand.DockCommand(string, string, string, string, bool)' is inaccessible due to its protection level
Telerik.Web.UI.DockCommand.DockCommand(string, string, string, string, bool)' is inaccessible due to its protection level
5 Answers, 1 is accepted
0
Vyrban
Top achievements
Rank 1
answered on 21 Nov 2008, 01:30 PM
Hi Stephen,
You can use this:
The code is form Telerik online RadDock example "My portal".
You can use this:
dock.Commands.Add(new DockCloseCommand()); |
dock.Commands.Add(new DockExpandCollapseCommand()); |
dock.Command += new DockCommandEventHandler(dock_Command); |
//.......... |
void dock_Command(object sender, DockCommandEventArgs e) |
{ |
//....... |
} |
0
Stephen
Top achievements
Rank 2
answered on 21 Nov 2008, 01:46 PM
I think I had seen that. What I want to do is add a new command. I think what you described just adds the command from the existing set (Close, Pin, Expand/Collapse). I need to add a new icon to enable different functionality. If you think I can do that with what you suggested I'll look over that again as I must be missing something.
0
Vyrban
Top achievements
Rank 1
answered on 21 Nov 2008, 03:57 PM
Hi Stephen,
Of course these are the default commands. For Custom Command "Reload" You can use this code:
Think this will help you :)
Of course these are the default commands. For Custom Command "Reload" You can use this code:
protected void Page_Load(object sender, EventArgs e) |
{ |
DockCommand command = new DockCommand(); |
command.Name = "Reload"; |
RadDock1.Command += new DockCommandEventHandler(RadDock1_Command); |
RadDock1.Commands.Add(command); |
RadDock1.CommandsAutoPostBack = true; |
} |
void RadDock1_Command(object sender, DockCommandEventArgs e) |
{ |
if (e.Command.Name == "Reload") |
{ |
//Do what is supposed to do |
} |
} |
0
Unified Development
Top achievements
Rank 1
answered on 09 Feb 2010, 05:52 PM
I have almost this exact code and for the life of me I can't get the function to fire, the page never posts back.
Do you see anything wrong here?
RadDock rd = new RadDock();
rd.ID = usage + "_" + "FORM_" + loadedForm.getID() + "_" + ff.getFormFieldID() + "_" + ffs.getFormFieldSettingsID();
rd.DockMode = DockMode.Docked;
rd.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;
rd.Width = 300;
rd.Height = 80;
rd.AutoPostBack = true;
rd.CommandsAutoPostBack = true;
rd.Command += new DockCommandEventHandler(Dock_Command);
DockCommand command = new DockCommand();
command.AutoPostBack = true;
command.Name = "Command1";
command.Text = "Command1";
rd.Commands.Add(command);
And here is the event
protected void Dock_Command(object sender, DockCommandEventArgs e)
{
Response.Redirect("alskfj alsdjf lasj lasdjf lasjfk");
}
The redirect never fires, why?
Thanks,
Derek
Do you see anything wrong here?
RadDock rd = new RadDock();
rd.ID = usage + "_" + "FORM_" + loadedForm.getID() + "_" + ff.getFormFieldID() + "_" + ffs.getFormFieldSettingsID();
rd.DockMode = DockMode.Docked;
rd.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;
rd.Width = 300;
rd.Height = 80;
rd.AutoPostBack = true;
rd.CommandsAutoPostBack = true;
rd.Command += new DockCommandEventHandler(Dock_Command);
DockCommand command = new DockCommand();
command.AutoPostBack = true;
command.Name = "Command1";
command.Text = "Command1";
rd.Commands.Add(command);
And here is the event
protected void Dock_Command(object sender, DockCommandEventArgs e)
{
Response.Redirect("alskfj alsdjf lasj lasdjf lasjfk");
}
The redirect never fires, why?
Thanks,
Derek
0
Hi Derek,
Please check at what stage in the page lifecycle the dock is added to the page. If it's added after the Command event is triggered the code will never be executed.
I created a sample project and could not reproduce the problem. It is attached to the thread.
Kind regards,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Please check at what stage in the page lifecycle the dock is added to the page. If it's added after the Command event is triggered the code will never be executed.
I created a sample project and could not reproduce the problem. It is attached to the thread.
Kind regards,
Pero
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.