Hi
I'm experiencing a problem with RadTreeView when NodeTemplate has got a RadGrid inside of it. This generally works correct, but when ExpandMode="ServerSideCallBack" is used for node it gives an error message on expand, saying:
Script control 'testGrid' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl
This simple test page shows the problem for me:
Codebehind:
In case there is a workaround for this - please note that I would like this to work for client-side added node also (Add button in sample above).
I'm experiencing a problem with RadTreeView when NodeTemplate has got a RadGrid inside of it. This generally works correct, but when ExpandMode="ServerSideCallBack" is used for node it gives an error message on expand, saying:
Script control 'testGrid' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl
This simple test page shows the problem for me:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestGridInTree.aspx.cs" Inherits="TestGridInTree" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
AddServerNode = function (name, serverId) {
treeView = $find("<%= TestTree.ClientID %>");
treeView.trackChanges();
var node = new Telerik.Web.UI.RadTreeNode();
node.set_text(name);
node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack);
treeView.get_nodes().add(node);
treeView.commitChanges();
}
</
script
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
asp:Button
runat
=
"server"
ID
=
"btnAdd"
Text
=
"Add"
OnClientClick
=
"AddServerNode('client');return false;"
/>
<
Telerik:RadTreeView
runat
=
"server"
ID
=
"TestTree"
OnNodeExpand
=
"TestTree_NodeExpand"
>
<
NodeTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"lblTest"
Text
=
"test"
/>
<
telerik:RadGrid
runat
=
"server"
ID
=
"testGird"
/>
</
NodeTemplate
>
<
Nodes
>
<
telerik:RadTreeNode
runat
=
"server"
ID
=
"node1"
Text
=
"ClientSide"
ExpandMode
=
"ServerSide"
/>
<
telerik:RadTreeNode
runat
=
"server"
ID
=
"node2"
Text
=
"ServerSideCallBack"
ExpandMode
=
"ServerSideCallBack"
/>
</
Nodes
>
</
Telerik:RadTreeView
>
</
div
>
</
form
>
</
body
>
</
html
>
Codebehind:
using
Telerik.Web.UI;
public
partial
class
TestGridInTree : System.Web.UI.Page
{
protected
void
TestTree_NodeExpand(
object
sender, RadTreeNodeEventArgs e)
{
var node =
new
RadTreeNode(
"childnode"
);
e.Node.Nodes.Add(node);
}
}
In case there is a workaround for this - please note that I would like this to work for client-side added node also (Add button in sample above).