This is a migrated thread and some comments may be shown as answers.

Load UserControl into node

3 Answers 26 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 25 Feb 2010, 02:40 PM
Hello community

My RadTreeView works with ServerSideCallbacks. In a demo for myself I add a UserControl as a node to the TreeView - which works fine as long as I do not use Telerik components.
However, as soon as I use telerik components in the UserControl I get an error that " " is not a registered client script control.

How I use it:
protected void UrlTreeView_NodeExpand(object sender, RadTreeNodeEventArgs e) 
        { 
            RadTreeNode onDemandNode = new RadTreeNode(); 
            SubdomainProperties sp = LoadControl("~/Controls/SubdomainProperties.ascx"as SubdomainProperties; 
            onDemandNode.Controls.Add(sp); 
            //Configure the node to populate on demand as well 
            onDemandNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack; 
            //Add the node as a child of the currently expanded node 
            e.Node.Nodes.Add(onDemandNode); 
 
            e.Node.Expanded = true
        } 

Part of the UserControl itself:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SubdomainProperties.ascx.cs" 
    Inherits="XSite.XIS.Web.UI.Controls.SubdomainProperties" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Panel ID="subdomainPropertiesPanel" runat="server" style="padding:10px;"
... 
<telerik:RadDateInput runat="server"></telerik:RadDateInput> 
... 
</asp:Panel> 

I'd definitely appreciate any kind of help!

Thanks in advance
Best
Roman



3 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 25 Feb 2010, 02:45 PM
Hi Roman,

You cannot add ajax controls in this way, because when ServerSideCallBack ExpandMode is used, the treeview make an asynchronous request to the server, it's not updated the whole page. I suggest you use ServerSide ExpandMode in this scenario.

All the best,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Roman
Top achievements
Rank 1
answered on 25 Feb 2010, 03:05 PM
Hello Yana

Thanks for your answer.
Indeed, now it works. Is there any way this TreeView can be ajaxified considering the latter scenario?
Deriving from your reply I guess not, since every RadControl has to be registered..

Thanks again
Kind regards
Roman
0
Roman
Top achievements
Rank 1
answered on 26 Feb 2010, 08:10 AM
My latter guess was right, however the method found here gets quite close to the actual problem. It's worth having a look.

Thanks for the help
Kind regards
Roman
Tags
TreeView
Asked by
Roman
Top achievements
Rank 1
Answers by
Yana
Telerik team
Roman
Top achievements
Rank 1
Share this question
or