3 Answers, 1 is accepted
0
Hello Bob Duffy,
The server-side event that is raised is Command. You can handle it the following way:
1. Attach a handler in code-behind:
dock1.Command += new DockCommandEventHandler(dock_Command);
OR
attach a handler in ASPX:
<telerik:raddock id="dock1" runat="server" defaultcommands="ExpandCollapse" oncommand="dock_Command">
</telerik:raddock>
2. Handle the Command
void dock_Command(object sender, DockCommandEventArgs e)
{
if(e.Command.Name == "ExpandCollapse")
{
//your logic here
}
}
Make sure you set CommandsAutoPostback="true" so that upon clicking Collapse/Expand a postback wll be initiated.
You can also handle the command client-side by specifying the OnClientCommand property of RadDock. Let me know if you need further assistance with this.
Regards,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The server-side event that is raised is Command. You can handle it the following way:
1. Attach a handler in code-behind:
dock1.Command += new DockCommandEventHandler(dock_Command);
OR
attach a handler in ASPX:
<telerik:raddock id="dock1" runat="server" defaultcommands="ExpandCollapse" oncommand="dock_Command">
</telerik:raddock>
2. Handle the Command
void dock_Command(object sender, DockCommandEventArgs e)
{
if(e.Command.Name == "ExpandCollapse")
{
//your logic here
}
}
Make sure you set CommandsAutoPostback="true" so that upon clicking Collapse/Expand a postback wll be initiated.
You can also handle the command client-side by specifying the OnClientCommand property of RadDock. Let me know if you need further assistance with this.
Regards,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Jesper Broe Rasmussen
Top achievements
Rank 1
answered on 21 Sep 2007, 07:48 AM
I have a similiar problem here. I get a visible post (the page flickers) but the event method newDock_Command() is never executed...
Telerik.Web.UI.RadDock newDock = new Telerik.Web.UI.RadDock();
newDock.ID = "contactDock_" + currentContact.Account;
newDock.Title = "Kalender - " + currentContact.Cn;
newDock.AutoPostBack = true;
newDock.Command += new Telerik.Web.UI.DockCommandEventHandler(newDock_Command);
newDock.CommandsAutoPostBack = true;
Telerik.Web.UI.DockCloseCommand closeCommand = new Telerik.Web.UI.DockCloseCommand();
closeCommand.AutoPostBack = true;
newDock.Commands.Add(closeCommand);
newDock.Commands.Add(new Telerik.Web.UI.DockExpandCollapseCommand());
protected void newDock_Command(object sender, Telerik.Web.UI.DockCommandEventArgs e)
{
if (e.Command.Name.ToUpper() == "CLOSE")
{
this.uxRadDockZone.Controls.Remove((Control)sender);
}
}
0
Hi Jesper Broe Rasmussen,
As you can see in our online demos the exact same scenario works as expected. Please, review them carefully comparing your code to the one in the demos. If you continue to experience the same problem, please open a support ticket as demonstrated in the attached instructions and send us a simple running project demonstrating the issue you experience so we can work on it and provide more accurate assistance.
Regards,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
As you can see in our online demos the exact same scenario works as expected. Please, review them carefully comparing your code to the one in the demos. If you continue to experience the same problem, please open a support ticket as demonstrated in the attached instructions and send us a simple running project demonstrating the issue you experience so we can work on it and provide more accurate assistance.
Regards,
Petya
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center