I am creating the dock dynamuically and for some reason I am having trouble with the DockCommandEventHandler event firing the corresponding c# code in dock_CustomCommand. Did I miss some sort of initialization? Is what I am trying to do possible?
C#:
C#:
public
void
createWinlets(
string
title,
string
position,
string
reference)
{
RadDock dock =
new
RadDock();
UserControl ascx = (UserControl)Page.LoadControl(reference);
dock.Title = title;
dock.DockMode = DockMode.Docked;
dock.UniqueName = Guid.NewGuid().ToString().Replace(
"-"
,
"a"
);
dock.ID =
string
.Format(
"RadDock{0}"
, dock.UniqueName);
dock.Width = Unit.Percentage(50);
dock.Height = Unit.Pixel(275);
dock.Skin =
"Vista"
;
dock.EnableDrag =
false
;
dock.CommandsAutoPostBack =
true
;
dock.Commands.Add(
new
DockCloseCommand());
dock.Command +=
new
DockCommandEventHandler(dock_CustomCommand);
dock.ContentContainer.Controls.Add(ascx);
/*AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();
saveStateTrigger.ControlID = dock.ID;
saveStateTrigger.EventName = "Command";
UpdatePanel1.Triggers.Add(saveStateTrigger);*/
switch
(position)
{
case
"Left"
:
dock.Width = Unit.Percentage(48);
dock.Height = Unit.Pixel(240);
RadDockLeft.Controls.Add(dock);
break
;
case
"Right"
:
dock.Width = Unit.Percentage(48);
dock.Height = Unit.Pixel(240);
RadDockRight.Controls.Add(dock);
break
;
case
"Bottom"
:
dock.Width = Unit.Percentage(99);
dock.Height = Unit.Pixel(230);
RadDockBottom.Controls.Add(dock);
break
;
default
:
break
;
}
}
protected
void
dock_CustomCommand(
object
sender, DockCommandEventArgs e)
{
RadDock dock = (RadDock)sender;
lbl_error.Visible =
true
;
lbl_error.Text =
"DEBUG: Rad Dock Closed. "
+ dock.ID +
", "
+ dock.Title;
}