
I can't seem to get the content of a RadEditor2 control to update after the following code is ran.
However the ClickedNodeLabel.Text (an ASP Label control) updates just fine.
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
//Use the Deserialize method to create a RadTreeNode object from the JSON string representing the node
RadTreeNode clickedNode = new JavaScriptSerializer().Deserialize<RadTreeNode>(e.Argument);
RadEditor2.Content = clickedNode.Text;
ClickedNodeLabel.Text = clickedNode.Text;
}
Thank you for your help.
-Dan
here's the client side code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultTV.aspx.cs" Inherits="Pages_DefaultTV" %>
<%
@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%
@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="cc3" %>
<%
@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head id="Head1" runat="server">
<link href="Site.css" rel="stylesheet" type="text/css" />
<style type="text/css">
span#total,
#ClickedNodeLabelPanel
{
display: inline !important;
font-style:italic;
}
.RadTreeView { border: 1px solid #CBE7F5; }
#ConfiguratorPanel1 ul
{
margin:0;
padding:0;
list-style:none;
}
#ConfiguratorPanel1 li
{
line-height: 28px;
}
#ConfiguratorPanel1 li label
{
padding: 0 7px;
}
</style>
</
head>
<
body>
<form runat="server" id="Form1" method="post">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ClickedNodeLabel" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<ul>
<li style="width:300px;border:none;"><label>Load time:</label><span id="Span1">Expand the 'Root Node' to see the load time</span></li>
<li style="width:220px;"><label>Number of nodes to load:</label>
<telerik:RadNumericTextBox runat="server" ID="NodeCountTextBox" Value="1000" MaxValue="4000"
MinValue="100" Width="60px" ShowSpinButtons="True">
<NumberFormat DecimalDigits="0" />
</telerik:RadNumericTextBox></li>
<li><label>Clicked node:</label><asp:Label runat="server" ID="ClickedNodeLabel" Text="None" /></li>
<telerik:RadEditor ID="RadEditor2" runat="server" Width="97%">
</telerik:RadEditor></ul>
<div id="topPane">
<h1>eTariff Editor</h1>
<asp:LinkButton ID="LinkButton1" runat="server" Style="position: absolute; left: 200px;
top: 75px" Width="125px">Open</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" Style="position: absolute; left: 250px;
top: 75px" Width="125px">Save</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" Style="position: absolute; left: 300px;
top: 75px" Width="125px">Submit</asp:LinkButton>
</div>
<div id="treePane">
<div>
<cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID="Panel1" DragHandleID="RadTreeView1"></cc1:DragPanelExtender>
<cc1:ResizableControlExtender ID="ResizableControlExtender1" runat="server" TargetControlID="Panel2" HandleCssClass="handle" ResizableCssClass="resizing" ></cc1:ResizableControlExtender>
</div>
<asp:Panel ID="Panel1" runat="server" Height="575px" ScrollBars="None" Width="174px">
<asp:Panel ID="Panel2" runat="server" Height="100%" ScrollBars="Both" Width="100%" BackColor="whitesmoke">
<telerik:RadTreeView ID="RadTreeView1" runat="server" Height="100%" Width="100%"
PersistLoadOnDemandNodes="false" LoadingStatusPosition="BelowNodeText"
OnClientNodePopulating="nodePopulating" OnClientNodePopulated="nodePopulated"
OnClientNodeCollapsed="nodeCollapsed" OnClientNodeClicked="nodeClicked">
<WebServiceSettings Path="~/Services/Default.asmx" Method="GetChildNodes" />
</telerik:RadTreeView>
</asp:Panel>
</asp:Panel>
</div>
<div id="editorPane">
<div>
<cc1:DragPanelExtender ID="DragPanelExtender3" runat="server" TargetControlID="Panel3" DragHandleID="Panel4"></cc1:DragPanelExtender>
<cc1:ResizableControlExtender ID="ResizableControlExtender3" runat="server" TargetControlID="Panel3" HandleCssClass="handle" ResizableCssClass="resizing"></cc1:ResizableControlExtender>
</div>
<asp:Panel ID="Panel3" runat="server" Height="600px" ScrollBars="None" Width="800px" >
<asp:Panel ID="Panel4" runat="server" Height="100%" ScrollBars="Both" Width="100%" BackColor="whitesmoke">
<%
-- <ConfiguratorPanel runat="server" ID="ConfiguratorPanel1" Expanded="true">
<cc3:RichTextEditor id="Rte1" Theme="classic" runat="server" Width="97%" Font-Strikeout=true ></cc3:RichTextEditor>
--
%> <telerik:RadEditor ID="RadEditor1" runat="server" Width="97%">
</telerik:RadEditor>
</asp:Panel>
</asp:Panel>
</div>
<telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
<script type="text/javascript">
var startTime;
function nodePopulating(sender, args) {
//Pass the number of nodes to the web service method
var input = $find("<%= NodeCountTextBox.ClientID %>");
if (args.get_context())
args.get_context().NumberOfNodes = input.get_value();
//Log the start time
startTime =
new Date();
}
function nodePopulated(sender, args) {
//Log the end time
var endTime = new Date();
//Display the total time
$get(
"total").innerHTML = endTime - startTime + "ms";
}
function nodeCollapsed(sender, args) {
//Clear the nodes populated on demand
resetNode(args.get_node());
}
function resetNode(node) {
node.get_nodes().clear();
node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.WebService);
}
function nodeClicked(sender, args) {
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
//Send an Ajax request containing the JSON representation of the clicked node. The AjaxRequest will be fired in codebehind.
ajaxManager.ajaxRequest(args.get_node().toJsonString());
}
</script>
</telerik:RadScriptBlock>
</form>
</
body>
</
html>
Hey,
i am just starting to work with telerikcontrols. maybe my question is very easy to answer, but i couldnt find a solution to sort my problem out. i didnt even know, if i am posting in the correct forum, but i couldnt find a forum called RadMultipage.
Well ill have a try to describe my problem.
i have a main page called default.aspx. that page contains some controls. one of them is a radmultipage with 3 radpageview and another control is a radmenu.
if i click on a radmenuitems i want to send some informations to a radmultipageitem.
for example...
my first radviewpage open another file called "file1.ascx". this page contains a label. when i am now clicking on a menuitem(on my default.aspx), i want to set the text of my label(file1.asxy) with the value of the menuitem.
How can i do this?
Thanks
Chris
I have a usercontrol called "uc_Email.ascx" and I have a corresponding edit page called "EditEmail.aspx". When the user clicks an Add button or an Edit button from within the email grid in the user control, the EditEmail.aspx page opens up in a radWindow. Therefore I have a RadWindowManager within my user control.
I have another user control that basically does the same thing, except it's for managing phone numbers instead of email addresses.
Both of these user controls are contained within one parent page (which happens to be a content page within a nested master page), and thus when the page is rendered there are two RadWindowManagers.
My problem is that I can't get either user control to look at the specific "Window" that I'm trying to reference. For instance, my ShowDialog function takes two parameters - the URL and the name of the Window. The URL is being opened just fine, but it's using the settings from my radWindowManager and not the settings from the specific Window.
I tried a few different things:
1. First I tried having my javascript functions (ShowDialog, OnClientClose, etc.) contained within each of my user controls, and also both user controls had their own RadWindowManagers. The windows are opening up, but they are not using the specific settings from the Window that I am referencing. They are also both using the settings from one of the two radWindowManagers (i.e. the user control for phone numbers is using the settings from the radWindowManager that's on the user control for emails.). I did a simple test by changing the Title property of the radWindowManager.
2. Then I tried moving my javascript functions into a .js file and linking that file to my parent page (the functions are identical) so that they would only be rendered once. I also tried putting my RadWindowManager into my parent page as well.
3. I then tried moving my javascript functions into my main master page and putting the radWindowManager into my master page as well. That still didn't work.
#2 and #3 didn't work at all - I'm getting an "object doesn't support this property or method".
I was wondering if you had any insight as to how to handle this type of scenario - namely multiple user controls on a content page of a nested master page, each with it's own need for a radWindow.
Thanks in advance.
Steve
