Hello Dave,
I think the problem might be caused by the fact that, when the dock is created for the first time you are not adding the commands explicitly, and at any other time (i.e. on every postback) the dock is created from state with commands added explicitly. My suggestion is to always add the commands explicitly, as shown in the following sample code:
.aspx
.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class DockCustomCommands : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
CreateDock(RadDockZone1);
}
private void CreateDock(RadDockZone zone)
{
RadDock dock = new RadDock();
dock.ID = "RadDock1";
dock.Width = Unit.Pixel(300);
dock.Height = Unit.Pixel(300);
dock.Commands.Add(new DockCloseCommand());
dock.Commands.Add(new DockExpandCollapseCommand());
dock.AutoPostBack = true;
dock.CommandsAutoPostBack = true;
dock.Command += new DockCommandEventHandler(dock_Command);
AjaxUpdatedControl control = new AjaxUpdatedControl();
control.ControlID = Label1.ID;
AjaxSetting setting = new AjaxSetting(dock.ID);
setting.EventName = "Command";
setting.UpdatedControls.Add(control);
RadAjaxManager1.AjaxSettings.Add(setting);
RadDockZone1.Controls.Add(dock);
}
protected void dock_Command(object sender, DockCommandEventArgs e)
{
Label1.Text = e.Command.Name + " was clicked!";
}
}
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.