Hi all,
I am trying to load RadDock dynamically with controls on dock expand using AJAX. I have provided the code below the commented part is the problem. I am unable to get the control ID which raised the postback.
If possible provide me with the code to dynamically create the portal page with the ajaxified docks.
I am trying to load RadDock dynamically with controls on dock expand using AJAX. I have provided the code below the commented part is the problem. I am unable to get the control ID which raised the postback.
If possible provide me with the code to dynamically create the portal page with the ajaxified docks.
RadDock RadDock1 =
new
RadDock();
RadAjaxPanel AjPanel =
new
RadAjaxPanel();
RadDock RadDock2 =
new
RadDock();
RadAjaxPanel AjPanel2 =
new
RadAjaxPanel();
protected
void
Page_Init(
object
sender, EventArgs e)
{
Session[
"ExpandCtrlID"
] =
null
;
AjPanel.RenderMode = UpdatePanelRenderMode.Inline;
RadDock1.ID =
"RadDock1"
;
DockExpandCollapseCommand ex1 =
new
DockExpandCollapseCommand();
RadDock1.Commands.Add(ex1);
RadDock1.Collapsed =
true
;
RadDock1.Command +=
new
DockCommandEventHandler(RadDock1_Command);
RadDock1.ContentContainer.Controls.Add(AjPanel);
RadDock1.CommandsAutoPostBack =
true
;
RadDock1.OnClientCommand =
"DockOnClientCommand"
;
RadDockZone1.Controls.Add(RadDock1);
AjPanel2.RenderMode = UpdatePanelRenderMode.Inline;
RadDock2.ID =
"RadDock2"
;
RadDock2.Commands.Add(
new
DockExpandCollapseCommand());
RadDock2.Collapsed =
true
;
RadDock2.Command +=
new
DockCommandEventHandler(RadDock2_Command);
RadDock2.ContentContainer.Controls.Add(AjPanel2);
RadDock2.CommandsAutoPostBack =
true
;
RadDock2.OnClientCommand =
"DockOnClientCommand"
;
RadDockZone1.Controls.Add(RadDock2);
}
void
RadDock2_Command(
object
sender, DockCommandEventArgs e)
{
string
controlID = RadDock2.ClientID;
LoadUserControlInDock(controlID);
}
void
RadDock1_Command(
object
sender, DockCommandEventArgs e)
{
string
controlID = RadDock1.ClientID;
LoadUserControlInDock(controlID);
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
Label1.Text =
""
;
if
(Page.IsPostBack)
{
if
(ScriptManager1.IsInAsyncPostBack)
{
//RadDock dock;
//dock = sender as RadDock;
//string id = dock.ClientID.ToString();
LoadUserControlInDock(id);
Label1.Text =
"Asynchronous"
;
}
else
{
Label1.Text =
"Not Asynchronous"
;
}
}
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadDock1, AjPanel);
}
protected
void
LoadUserControlInDock(
string
contID)
{
Control c1 =
new
Control();
c1 =
this
.LoadControl(
"WebUserControl.ascx"
);
switch
(contID)
{
case
"RadDock1"
:
AjPanel.Controls.Clear();
AjPanel.Controls.Add(c1);
Test.Value =
"Loaded"
;
break
;
case
"RadDock2"
:
AjPanel2.Controls.Clear();
AjPanel2.Controls.Add(c1);
Test.Value =
"Loaded"
;
break
;
}
}