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

RadTreeView & Attributes (Client and Server side)

1 Answer 220 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 03 Feb 2009, 08:38 PM
Hi,

I have a problem with attributes add from server-side and access from client-side:

Into nodeBound event i set a attributes i set an attributes ID
    Private Sub rtvTagAvailable_NodeBound(ByVal o As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles rtvTagAvailable.NodeDataBound 
            Dim node As RadTreeNode = e.Node 
            node.Attributes.Add("ID", orgTag.ID.ToString) 
    End Sub 
 
 

from client-side function (not connected on OnClientNodeClicked) i try to get this attribute value and it's always undefined (idTag)
            var treeView = $find("<%= rtvTagAvailable.ClientID %>"); 
            var selectedNode = treeView.get_selectedNode(); 
            if(selectedNode) 
            { 
                var idTag = selectedNode.get_attributes().getAttribute("ID"); 
                if (idTag)  
                { 
                   <%=RadAjaxPanel1.ClientID%>.ajaxRequest("Delete;" + idTag ); 
                } 
            } 
 
 

but, into my code-behind i have access to this same attribute, but not client-side??

ty

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Feb 2009, 02:31 PM
Hi Jack,

Please change the attribute name to something different from "ID" and the code will work without a problem.

All the best,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Jack
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or