Hi I have a RadTreeView where I have implemented a context menu on the nodes.
when user clicks the menu item, the client side event fires and a modal popup is displayed to the user. the modal popup has 2 text boxes, when user enters value in those text boxes and submits the popup, the text box values are concatenated and sent back to the calling page, where this value id captured in a hidden field.
now the control goes to the server side context menu click event. here I am picking up the value from the hidden field, and do my tasks.
This works fine. the modal popup holds the execution until a value is submitted by the user. but the issue comes when I try to use radWindow instead of the modal popup.
I have added a radWindowManager and one child radWindow inside it.
and I am trying to invoke the radwindow in the context menu clicked on the client.
The problem is that unlike the modal popup, it does not hold the execution. the RadWindow appears but the server side code executes simultaneously, and since the hidden field ie empty, my code does not work. what could be the solution of this problem?
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
OnContextMenuItemClick
=
"RadTreeView1_ContextMenuItemClick"
OnClientContextMenuItemClicking
=
"onClientContextMenuItemClicking"
>
<
ContextMenus
>
<
telerik:RadTreeViewContextMenu
ID
=
"ctxMenuAddK1"
runat
=
"server"
>
<
Items
>
<
telerik:RadMenuItem
Value
=
"addNodeK1"
Text
=
"Add New K1 Node"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadTreeViewContextMenu
>
</
ContextMenus
>
</
telerik:RadTreeView
>
when user clicks the menu item, the client side event fires and a modal popup is displayed to the user. the modal popup has 2 text boxes, when user enters value in those text boxes and submits the popup, the text box values are concatenated and sent back to the calling page, where this value id captured in a hidden field.
case
"addNodeK1"
:
var
windowResult = window.showModalDialog(
"Controls\\newNodeK1.htm"
,
"Enter Value"
,
"dialogHeight: 300px; dialogWidth: 400px;"
);
document.getElementById(
'<%=HiddenField1.ClientID %>'
).value = windowResult;
break
;
now the control goes to the server side context menu click event. here I am picking up the value from the hidden field, and do my tasks.
protected
void
RadTreeView1_ContextMenuItemClick(
object
sender, RadTreeViewContextMenuEventArgs e)
{
switch
(e.MenuItem.Value)
{
case
"addNodeK1"
:
// get node name and node value from the hidden field.
string
nameValue = HiddenField1.Value;
}
}
This works fine. the modal popup holds the execution until a value is submitted by the user. but the issue comes when I try to use radWindow instead of the modal popup.
I have added a radWindowManager and one child radWindow inside it.
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
ShowContentDuringLoad
=
"false"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
runat
=
"server"
Skin
=
"Sunset"
EnableShadow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
Behaviors
=
"Close"
OnClientClose
=
"OnClientClose"
NavigateUrl
=
"Controls\\newNodeK1.htm"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
and I am trying to invoke the radwindow in the context menu clicked on the client.
var
oWnd = radopen(
"Controls\\newNodeK1.htm"
,
"RadWindow1"
);
The problem is that unlike the modal popup, it does not hold the execution. the RadWindow appears but the server side code executes simultaneously, and since the hidden field ie empty, my code does not work. what could be the solution of this problem?